How do I make Weblogic 10 prefer the jars in myApp.war:/WEB-INF/lib/ without throwing VerifyErrors?
Asked Answered
C

2

9

The Weblogic classloader seems to prefer system libraries over the libraries in my war's WEB-INF/lib/.

I've tried setting the following in WEB-INF/weblogic.xml, without success:

<weblogic-web-app>
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
</weblogic-web-app>

This just gives me a lot of VerifyErrors:

exception is java.lang.VerifyError: (class: org/apache/xerces/parsers/AbstractSAXParser, method: parse signature: (Lorg/xml/sax/InputSource;)V) Incompatible object argument for function call
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
        Truncated. see log file for complete stacktrace

(I'm trying to avoid packaging the WAR into an EAR.)

Copal answered 8/6, 2011 at 12:13 Comment(9)
What system libraries are these?Emera
prefer-web-inf-classes should work, I assume you've cleared out all temp folders and cached copies of the war within the domain?Unfruitful
Is this to do with the JAXP libraries that Weblogic helpfully includes in your war's classpath?Rayerayfield
There is a new option in WebLogic to use the perfer-application-packages in WAR files. What version are you using?Nauseous
@Jeff West: We use 11g. Which option is that?Copal
@artbristol: It looks like Weblogic have already loaded Sax components into the classpath, which crashes with differently versioned Sax in the War.Copal
WebLogic enables you to do bottoms-up classloading which loads from the WAR/EAR first, getting around the clashes.Nauseous
11g has multiple releases. Are you using 10.3.3 or 10.3.4, perhaps?Nauseous
If you want to continue the conversation, email me at [email protected]. Easier than message board for iterative work. We can post the result here.Nauseous
R
5

I was never able to fix this satisfactorily, other than by specifying -Djavax.xml.parsers.SAXParserFactory=[xerces sax parser factory class name] (and so on for the other JAXP factories like validation SchemaFactory) when starting Weblogic.

None of the filtering / prefer-web-inf stuff worked, possibly due to Weblogic requiring JAXP libraries on startup before it even reads any of the WAR / EAR config files.

Rayerayfield answered 15/6, 2011 at 7:55 Comment(0)
E
0

I had this problem too with tomcat-arquillian. Turns out "xml-apis 2.0.2" was in my classpath, which is actually xml-apis 1.0.b2 and which is too old to be compatible with xercesImpl 2.9.1 which requires xml-apis 1.3.04.

Ezechiel answered 24/8, 2011 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.