0 Replies Latest reply on Dec 12, 2006 9:39 AM by Johannes Mueller

    JAXB: java.lang.LinkageError when linking javax.xml.namespac

    Johannes Mueller Newbie

      In my ear archive, I switched parent delegation to false, because JBoss would load the wrong JAXB classes otherwise (from the server/lib folder instead from the jars given in the ear).

      Now, the correct JAXB classes are loaded, but there is a new kind of problem:

      When I try a

      JAXBContext jaxbContext = JAXBContext.newInstance("com.foobar.item");

      (which is using the javax.xml.namespace.QName to create a binding between XML and Java)

      I get the following error:
      javax.ejb.EJBTransactionRolledbackException: java.lang.RuntimeException: java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class

      On the following sites the same problem is described:


      What is the most "straightforward" way to solve this issue on a JBoss 4.0.4 AS?

      Removing the QName class from standard-jars does not seem to be very elegant, neither does copying the QName class in every bundle using it.

      I read




      and I think I understand the root cause of the problem (the QName class being loaded by two different class loaders). Nevertheless, I cannot solve the problem.

      Any help would be appreciated.