2

私のApache cxfクライアントWebサービスは、以下のように例外を受け取りました。ただし、'XML type name "address"' は、WSDL の soap:address の場所です。何が問題ですか?

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
4

2 に答える 2

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か?
  • ライブラリのバージョンを更新してみてください。バージョン間の一時的な不具合だったのかもしれません。

アップデート

java.net で報告されているのとまったく同じ問題が見つかりました。そこに投稿された解決策の 1 つは、基本的に「バージョンを更新する」ことです。また、何とかNetBeansに関連しているようです。

于 2014-10-15T13:25:39.890 に答える