ATG Rest full API addItemToOrder is not working

孤者浪人 提交于 2019-12-12 00:42:30

问题


I am working on ATG Web-commerce REST Full API, addItemToOrder is not working. This is the Error:

{
  "formError": true,
  "formExceptions": [
    {
      "localizedMessage": "Unable to process the request currently. Please try again after some time",
      "errorCode": "atg.droplet.DropletException"
    }
  ],
  "concurrentUpdate": false
}

http://IP:Port/rest/model/atg/commerce/order/purchase/CartModifierActor/addItemToOrder

I have checked the server log file, Null pointer exception is showing.

/atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler   ---     java.lang.NullPointerException
**** Error      /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at atg.siebel.catalog.SiebelCatalogTools.updateQuoteWithProfileDetails(SiebelCatalogTools.java:3681)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at atg.siebel.catalog.SiebelCatalogTools.checkProductEligibility(SiebelCatalogTools.java:3384)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at atg.siebel.validation.SiebelValidator.validateProductEligibility(SiebelValidator.java:141)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at atg.siebel.order.purchase.SiebelCartModifierFormHandler.preAddItemToOrder(SiebelCartModifierFormHandler.java:569)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at atg.commerce.order.purchase.CartModifierFormHandler.handleAddItemToOrder(CartModifierFormHandler.java:3035)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-143/atg/commerce/order/purchase/CartModifierFormHandler           at java.lang.reflect.Method.in

(there are more lines of error Unable to post here), Would it be because of product sync issue? or sku's issue..?

Please help


回答1:


Still a bit difficult to work out exactly where the error is but considering that you are calling the updateQuoteWithProfileDetails(Quote,RepositoryItem) method and in the calling method there is a null check on the RepositoryItem (profile) and Quote is new, then the only line that could end up with a NullPointerException in the calling code is:

parentOrganizationOfProfile = (RepositoryItem) profile.getPropertyValue(getProfilePropertyParentOrganization());

Which means that the ProfileParentOrganisation value on the profile RepositoryItem is null.

The rest of the code in that method (according to the source provided by ATG in the reference application) all provide null checks.



来源:https://stackoverflow.com/questions/38183721/atg-rest-full-api-additemtoorder-is-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!