Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException

While implementing jax-ws web client using wsimport sometimes you will get the below error.

Problem:

Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://AkServices.com/}getReturnText". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:

Solution:
wsimport -keep http://localhost:8080/MySoapWebService/hello?wsdl -target 2.0

(Generate code as per the given JAX-WS specification version. version 2.0 will generate compliant code for JAX-WS 2.0 spec.)

No comments:

Post a Comment