cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot cast class java.util.Collections$SynchronizedMap to class java.util.LinkedHashMap

Former Member
0 Kudos

Hi,

I have this error in Pi system, what does this mean? this happened after patch upgarde from SP11 to SP16 on PI 7.1

Message processing failed. Cause: java.lang.ClassCastException: Cannot cast class java.util.Collections$SynchronizedMap to class java.util.LinkedHashMap

Thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor

Hi Prema,

Does your response/request mapping have any UDF/java mapping? Please check.

In order to understand cause of ClassCastException, you need to be familiar with concept of type casting in Java. Since Java is an object oriented programming language and supports features like Inheritance and Polymorphism, a reference variable of type parent class can represent object of child class. This leads to ClassCastException if object is not of type on which you are casting it. It can be best explained with an example. Let's see a sample code which will throw ClassCastException in Java

Object im = new String();
Integer i = (Integer) im; 

This code results in Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer at test.ClassCastExcetpionTest.main(ClassCastExcetpionTest.java:31)

Thus some code in java mapping/UDF is having this issue with upgrade the old code has become invalid.

Please kindly check and revert.

Regards

Anupam

Former Member
0 Kudos

Hi Anupum,

i do not have any UDFs, also mapping works good when tested.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Prema,

Must be an issue with java version deployed in new version of PI.

Basis team should look into this error.

Regards

Anupam

former_member190293
Active Contributor

Hi Prema!

Where does this error happen? If it happens during message mapping execution, you should check if any UDF (or java mapping) uses assignments to SAP inner class instances as their implementations could be changed with this Service pack.

Regards, Evgeniy.

Former Member
0 Kudos

Hi Evgeniy,

this doesnt happen when mapping, but this error i see in receiver adapter.

this interface has request and response. request goes all the way through calling adapter. but response has this error.

and i did unit testing in mapping with payload. request mapping looks good.

Please let me know any other thoughts.

thanks for your time and help!

prema

former_member190293
Active Contributor
0 Kudos

And did you test response mapping as well?

Regards, Evgeniy.

Former Member
0 Kudos

i did not get response payload back. all i see is error in response. so no idea how i get that payload. and test it.

former_member190293
Active Contributor
0 Kudos

You could start with testing your response message mapping in editor on the "Test" tab using any example values. Just to check if your mapping works without issues after upgrade.

Regards, Evgeniy.

Former Member
0 Kudos

yes, i got the payload from earlier successful message before patch update, and tested. the response message looks good aswell.

former_member190293
Active Contributor
0 Kudos

I quess that you should contact your BASIS team to confirm that all the components of AS Java were upgraded to correct versions without any issues and errors.

Regards, Evgeniy.

Former Member
0 Kudos

thanks Evgeniy.

yes the patch16 was not deployed properly some of the components were still on patch 11.

basis is deploying it. i will update if that is the resolution.

former_member190293
Active Contributor
0 Kudos

Yes, Prema, this definitely might be the case. One component is upgraded and uses the new implementation while the other continues to use the old one.

Regards, Evgeniy.