Skip to main content

com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
satishraos
Offline
Joined: 2013-01-08
Points: 0

Hi,

I am developing a simple Java client to consume a web service that will be deployed on Websphere application server. I am able to get it working successfully on JBoss server, however the same is not working on Websphere application server. When it tries to instantiate the service instance, it throws WebServiceExcpetion error pointing to the root cause as -

Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:222)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.(ProviderImpl.java:88)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
... 33 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
this problem is related to the following location:
at javax.xml.ws.wsaddressing.W3CEndpointReference$Address
at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
at javax.xml.ws.wsaddressing.W3CEndpointReference
Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties
at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
this problem is related to the following location:
at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements
at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters
at javax.xml.ws.wsaddressing.W3CEndpointReference

The stubs are generated using wsimport with the keep option and I'm using JAX-WS RI 2.1.7-b01 jaxws-rt.jar. I read that the MemberSubmissionEndpointReference class should have two annotations in its Address and Elements classes.

@XmlType(name="address", namespace=MemberSubmissionEndpointReference.MSNS) for Address class.
@XmlType(name="elements", namespace=MemberSubmissionEndpointReference.MSNS)for Elements class.

Can someone please confirm that these annotations is available in the MemberSubmissionEndpointReference class present in JAX--WS RI 2.1.7-b01. Is there any update to the jaxws-rt.jar that I should be having. The reason I beleive that it works on JBoss but not on WAS is may be because IBM has stricter validation against the generated stubs and JBoss is lenient. Also, note jaxws-rt.jar is the only jar available at WAS as part of my own application library. There is no conflict in classloaders. Sincerely appreciate your help.