Getting Java.lang.LinkageError: ClassCastException

1.8k Views Asked by At

Trying to run my flex project and I get the below error , Please suggest any way forward :-

Caused by:

java.lang.LinkageError: ClassCastException: attempting to castjar:file:/software/bea/java/jdk1.8.0_152/jre/lib/rt.jar!/javax/xml/ws/spi/Provider.class to zip:/wls_domains/abct22/servers/managed13_abct22/tmp/_WL_user/xyz/2o9q1y/war/WEB-INF/lib/jaxws-api.jar!/javax/xml/ws/spi/Provider.class
    at javax.xml.ws.spi.Provider.provider(Provider.java:94)
    at javax.xml.ws.Service.<init>(Service.java:56)
    at com.oracle.xmlns.communications.ordermanagement.OrderManagementService.<init>(OrderManagementService.java:71)
    at com.df.abc.action.np.npAction.omsWebSerCall(npAction.java:3741)
    at com.df.abc.action.np.npAction.omsWebServiceCall(npAction.java:3683)
    ... 73 more
1

There are 1 best solutions below

0
On

You have two versions of the same jar on the classpath. The error mean that you have an object created from one jar which the code tries to cast to the other jar, which doesn’t work.

This is not an uncommon problem.

Revise your deployment not to include the jaxws-api.jar as long as you are still deploying to a Java 8 server.