Getting "different Class objects for the type javax/xml/namespace/QName used in the signature" exception while using Jaxb in JBoss EAP

Solution Unverified - Updated -

Issue

While Using the following Maven plugin to generate classes :

  <groupId>com.sun.tools.xjc.maven2</groupId>
  <artifactId>maven-jaxb-plugin</artifactId>
   <version>1.1.1</version>

a RuntimeException is thrown :

    java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.create(Ljava/net/URL;Ljavax/
    xml/namespace/QName;)Ljavax/xml/ws/Service;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of
    the current class, com/example/MyClass, and the class loader (instance of <bootloader>) for resolved class, javax/xml/ws/Service, 
    have different Class objects for the type javax/xml/namespace/QName used in the signature

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.