简体   繁体   中英

ClassCastException with Weblogic 10.3.3/Pitchfork

We're trying to deploy a spring application to Weblogic 10.3.3. We created a war file, which works nicely with tomcat, but, when trying to package it up as an ear to use with weblogic, we're getting an issue with Pitchfork:

java.lang.ClassCastException : org.springframework.jee.spi.PitchforkUtilsImpl cannot be cast to com.oracle.pitchfork.interfaces.PitchforkUtils

Why is Weblogic trying to cast this, and what are we doing wrong?

Thanks.

Notice that the error message mentions two different flavours of PitchforkUtils, which appear to be incompatible.

Without being familiar with Pitchfork, could it be an import which has been automatically "fixed" in the porting process - Eclipse can automatically resolve imports - to resolve against the Oracle PitchforkUtils instead of the one you actually want to use?

This says that WebLogic has its own version of the Pitchfork JAR, which the classloader is finding before it gets to the Spring version in your WEB-INF/lib.

Remove the Pitchfork JAR from your web context and see if that fixes the issue.

If your code imports the Spring version, you'll have to alter the code to use Oracle's.

You can also tell the class loader to prefer your app JARs to server level JARs. It's an entry in your weblogic.xml: <prefer-application-packages/>

http://relation.to/Bloggers/Weblogic10SeamAndEJB3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM