我的apache cxf客户端Web服务异常如下所示。但是,'XML类型名称“地址”'是我的WSDL的soap:地址位置。问题是什么?
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
答案 0 :(得分:1)
这很有趣。这不是一个完整的答案,但这可能有所帮助。
com.sun.xml.ws.developer.MemberSubmissionEndpointReference.Address
课程没有注释,也没有package-info.java
。所以类型应该命名为address
,没有命名空间。
班级javax.xml.ws.wsaddressing.W3CEndpointReference.Address
也没有注释,但有一个package-info.java
:
@javax.xml.bind.annotation.XmlSchema(namespace=W3CEndpointReference.NS,
location="http://www.w3.org/2006/03/addressing/ws-addr.xsd")
package javax.xml.ws.wsaddressing;
因此它应该被命名为{http://www.w3.org/2005/08/addressing:address
。所以理论上应该没有冲突。
我建议如下:
package-info.java
中有javax.xml.ws.wsaddressing
吗?com.sun.xml.ws.developer
中有一个吗?<强>更新强>
我发现了完全相同的问题reported on java.net。其中一个解决方案基本上是&#34;更新您的版本&#34;。似乎也以某种方式与NetBeans相关。