JAX-WS Naming Issue with @webmethod Using WRAPPED Convention

(Doc ID 988792.1)

Last updated on APRIL 04, 2018

Applies to:

Oracle WebLogic Server - Version 10.3 and later
Information in this document applies to any platform.


The issue occurs when webmethod is of the following format:
       public xxxxxResponse xxxxx(MyTestRequest message)

For example:
       public TestResponse test(MyTestRequest message)

After creating the JAX-WS webservice, the following exception is thrown, upon deployment of this webservice:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://example.org}testResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location:
at examples.webservices.simple.TestResponse
at private examples.webservices.simple.TestResponse examples.webservices.simple.jaxws.TestResponse._return
at examples.webservices.simple.jaxws.TestResponse this problem is related to the following location:
at examples.webservices.simple.jaxws.TestResponse
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
Truncated. see log file for complete stacktrace


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms