Webservice create operation error -Exception occurred in handling object request for ''null''

I am unable to create account . Testing on Postman , the create operation with the same body works seamlessly.

I am getting this error- Exception occurred in handling object request for ‘‘null’’ for operation ‘‘Create’’
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.lang.String

Response mapping of all attributes for Create operation is configured

After some digging around , i found out this error is related to the nativeIdentity which is “id” in this case which is a string attribute . Please refer the processedResponse object in logs . The processed response object has arrayList objects .Is it because it is trying to parse the ArrayList ‘id’ into String ‘id’ (identity Attr)

I am not sure what is happening . Can someone please guide

@sa8173

@kalyankumar_saha

@manjesh_kumar 
Log.xml (17.2 KB)

Hi  @swappy

Not sure whats going on there, but I think you can handle it by customizing the processedResponseObject in after operation rule, just process through map and set each field again after manually type casting them as per schema like single values or multi valued.

My another guess is that It might be for a different field which is defined as single values but query is pulling it as multi valued.

Hope this helps.

Thanks,
Manjesh

You would need to add application xml to confirm but usually this is a case with wrong type of the attribute.

Thanks for the help  @manjesh_kumar  and  @kjakubiak  .

I had wrong reponse mapping configured in Create Operation . This error was getting thrown because my userId (nativeIdentity) was a string attribute and the processed response object showed it as a list .

I also had to reconfigure the Account aggregation schema .

All the accounts that were getting aggregated were of the type [User1] , instead of User1 . Once that got fixed , it worked !

@swappy

I am glad it worked out for you.

Thanks,
Manjesh