While calling soap based webservice receiving error message JAXB - IllegalAnnotationsException - Two classes has the same XML Type name issue

Solution Unverified - Updated -

Issue

  • User has a custom bundle X that communicates to a external rule/policy engine via SOAP WS.
  • User's application feature includes this bundle and directly makes Java API calls to interact with the policy engine.
  • When the bundle X tries to load the JAXBContext via newInstance(class-name), the below error message is thrown.
  • Please note that, the junit test cases with in the bundle X runs without any issues in a standalone mode where as when running under Fuse context, it always throws these "IllegalAnnotationException" - Two classes has the same XML Type name.
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 9 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://aaa/bbb/ccc/types}TextDataType". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at xxx.yyy.zzz.Class1
        at xxx.yyy.zzz.Class2
        at protected java.util.List xxx.yyy.zzz.Class3
        at xxx.yyy.zzz.Class4
        ---
                ---
    this problem is related to the following location:
        at xxx.yyy.zzz.Class1
        at xxx.yyy.zzz.Class2
        at protected java.util.List xxx.yyy.zzz.Class3
        at xxx.yyy.zzz.Class4
                ---
                ---
Two classes have the same XML type name "{http://aaa/bbb/ccc/types}Class1". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at xxx.yyy.zzz.Class1
        at xxx.yyy.zzz.Class2
        at protected java.util.List xxx.yyy.zzz.Class3
        at xxx.yyy.zzz.Class4
                --- 
                ---
    this problem is related to the following location:
        at xxx.yyy.zzz.Class1
        at xxx.yyy.zzz.Class2
        at protected java.util.List xxx.yyy.zzz.Class3
        at xxx.yyy.zzz.Class4
                --- 
                ---

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content