Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.)

like image 235
neu242 Avatar asked Jun 08 '11 12:06

neu242


2 Answers

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.

like image 160
artbristol Avatar answered Nov 08 '22 10:11

artbristol


This video gives a good overview of the options you have for configuring the WebLogic FilteringClassLoaders:

http://www.youtube.com/watch?v=ArLTKapjV_8

like image 41
Jeff West Avatar answered Sep 17 '22 12:09

Jeff West