Wednesday, October 30, 2013

IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions

Share at Facebook


Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://.../}YourClass". Use and @XmlType.namespace
to assign different names to them.
   this problem is related to the following location:


A probable reason is that you might be having two Java classes which you are trying to expose through the webservice. That's why the JAX-WS is confused with this and popping out the exception.


Using the XmlType annotation can rescue you from this odd situation. Just use the annotation at the top of your java class and give a different name through the name attribute. For example:


No comments: