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

neu242
  • 15,796
  • 20
  • 79
  • 114

2 Answers2

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.

artbristol
  • 32,010
  • 5
  • 70
  • 103
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.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120