ClassCastException with Weblogic 10.3.3/Pitchfork

不问归期 提交于 2019-12-11 04:16:01

问题


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.


回答1:


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?




回答2:


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



来源:https://stackoverflow.com/questions/3650397/classcastexception-with-weblogic-10-3-3-pitchfork

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!