This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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

Linkage error in Jboss 4 & 3.2.7 when using Jaxb2

peter coster

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>(
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(
at com.sun.xml.bind.v2.ContextFactory.createContext(
at com.sun.xml.bind.v2.ContextFactory.createContext(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at javax.xml.bind.ContextFinder.newInstance(
at javax.xml.bind.ContextFinder.find(
at javax.xml.bind.JAXBContext.newInstance(
at javax.xml.bind.JAXBContext.newInstance(

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

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:

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

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

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:


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:
subject: Linkage error in Jboss 4 & 3.2.7 when using Jaxb2
It's not a secret anymore!