aspose file tools*
The moose likes XML and Related Technologies and the fly likes Linkage error in Jboss 4 & 3.2.7 when using Jaxb2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Linkage error in Jboss 4 & 3.2.7 when using Jaxb2" Watch "Linkage error in Jboss 4 & 3.2.7 when using Jaxb2" New topic
Author

Linkage error in Jboss 4 & 3.2.7 when using Jaxb2

peter coster
Greenhorn

Joined: Jan 13, 2006
Posts: 26
This is the stacktrace:

java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:779)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:25)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:78)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:41)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:97)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:44)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:320)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:198)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)


Google told us that this is because of the fact that different packages (xbeans-2.2, jsr172, axis1.3) all contain this javax/xml/namespace/QName class, as does java5. Knowing that I don't really now how I can solve this. Also, I really really don't understand why I seem to be the only one having this problem.

The project is a war project running solo, the error occurs when invoking JAXB, not before. Which is strange I think as Xfire is used for logging in


Thank you in advance.
peter coster
Greenhorn

Joined: Jan 13, 2006
Posts: 26
Removing the javax.xml.namespace package from the stax-api.jar and from the xbean.jar "solves" the problem. Off course that is not a real solution.

This was a bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6402423

somehow it got closed, but I don't understand why ?

PS: am I posting in the correct thread?
peter coster
Greenhorn

Joined: Jan 13, 2006
Posts: 26
I don't want to spam this topic, but I've found another possible solution -

Currently the webapp has the following in its jboss-web.xml file:

<class-loading>
<loader-repository>
myapp.com:loader=myapp.war
</loader-repository>
</class-loading>


when I remove this, the application works with the multiple Qnames, problem is that off course this loader-repository option is put there for a reason - the application is installed in production together with a much older ear. Withouth the above everything explodes...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Linkage error in Jboss 4 & 3.2.7 when using Jaxb2