Search code examples
jbossclassloaderjboss6.x

JBoss 6 classloader issue


I'm trying to deploy a WAR application on JBoss 6. I'm getting a LinkageError:

java.lang.LinkageError: loader constraint violation: 
when resolving interface method "javax.xml.stream.XMLStreamReader.getName()Ljavax/xml/namespace/QName;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/codehaus/xfire/soap/handler/ReadHeadersHandler, 
and the class loader (instance of <bootloader>) for resolved class, javax/xml/stream/XMLStreamReader, have different Class objects for the type javax/xml/namespace/QName used in the signature

So I'm trying to setup a classloader repository WEB-INF/jboss-web.xml file:

<class-loading>
 <loader-repository java2ClassLoadingCompliance="false">
 com.example:archive=unique-archive-name
    <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
 </loader-repository>
</class-loading>

but I'm still getting the same error, any ideas?


Solution

  • This means two copies of javax/xml/namespace/QName are being loaded by two different classloaders. This thread and this one have a couple of useful responses that should help you get started on figuring out how dig deeper and hopefully get past this problem.