Skip to Content
0

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

Jun 27, 2017 at 09:58 PM

375

avatar image

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Anupam Ghosh Jun 29, 2017 at 12:09 PM
1

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Anupum,

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

0

Hi Prema,

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

Basis team should look into this error.

Regards

Anupam

0
Evgeniy Kolmakov Jun 28, 2017 at 01:18 PM
1

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.

Show 8 Share
10 |10000 characters needed characters left characters exceeded

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

0

And did you test response mapping as well?

Regards, Evgeniy.

0

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.

0

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.

0

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

0

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.

0

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.

0

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.

0