0

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

Syam Nath
  • 45
  • 10

1 Answers1

0

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.

radimpe
  • 3,197
  • 2
  • 27
  • 46
  • I am using ATG Restful API, Bit confused as I am new the domain. AddtoCart method is not related to CRM right?, so I dont need to check CRM log. Hoping addtoCart doesnot need to communicate to CRM. – Syam Nath Jul 07 '16 at 13:18
  • I am calling addItemToOrder API, not aware of inner methods. Please Advise. – Syam Nath Jul 07 '16 at 13:23
  • As I said in my answer, your `ProfileParentOrganisation` of the `profile` you are trying to use is `null`. Check your data. – radimpe Jul 18 '16 at 16:00
  • hi, there was no progress, As I am new to ATG I am feeling difficulty and tried multiple ways to understand the answer. I have some query about the same, 1.> Is this addItemToOrder is calling any Siebel web services? 2.> Or this call is within the ATG? 3.> If its calling Siebel service, Please explain about the web service – Syam Nath Jul 22 '16 at 06:52
  • I've never worked with the Siebel integration but what I can say is that your problem is in your data in the ATG instance. You probably only need to setup a `ProfileParentOrganisation` on the user you are trying to use for the query. This is likely done via the BCC. – radimpe Jul 22 '16 at 08:45
  • I haven't used the ACC in years but I believe it will work. – radimpe Jul 22 '16 at 09:07
  • tried creating Organizations and added user to that organization, But now the error got changed.**Unsupported Content-Type: text/html;charset=UTF-8 Supported ones are: [text/xml]**, tried changing the content-type to supported one, after this step **Session mismatch** error, Other API's are working fine with the content-type : application/json. please advise. – Syam Nath Jul 27 '16 at 10:30
  • That sounds like a new error which has a new stack trace which probably should be a new question. – radimpe Jul 28 '16 at 05:39
  • Added new Question http://stackoverflow.com/questions/38637190/working-with-atg-rest-full-api-additemtoorder-error -- Please check and advise. – Syam Nath Jul 28 '16 at 13:02