views:

124

answers:

2

Hi.

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.

A: 

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?

Thorbjørn Ravn Andersen
Hi. Thanks for the response. I don't think this is it, though - I'm not overly familiar with pitchfork, but I believe it's the Spring extension to allow it to work with weblogic. We followed the instructions at http://download.oracle.com/docs/cd/E12839_01/web.1111/e14453/enable_spring.htm and added pitchfork.jar to the weblogic classpath, so I don't see why weblogic would then try to resolve it as a different type.
A: 

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

duffymo
Thanks for the comments. Unfortunately, we're not packaging pitchfork.jar up with the application - as per the instructions at http://download.oracle.com/docs/cd/E12839_01/web.1111/e14453/enable_spring.htm we've put it on the weblogic classpath, so I don't think setting the <prefer-application-packages> would help. Furthermore, we downloaded pitchfork.jar via the link on the oracle site, so I'm suprised it doesn't play nicely with interfaces weblogic wants to use. We currently have our ear deployed against JBoss, anyway, which is working OK. But we may need to change it in future. Thanks!