Skip to Content
avatar image
Former Member

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

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 29, 2017 at 12:09 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 28, 2017 at 01:18 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded