0

アプリで Spring Web サービスと Axis2 の両方を使用しています。それらは完全に独立しており、Spring WebServiceTemplate が以下の例外をスローし始めたことを除いて、うまく機能します..

Spring が saaj.jar (javax.xml.soap.SOAPElement を含む) を必要とし、Axis2 が axiom-dom.jar (org.apache.axiom.om.impl.dom.ElementImpl を含む) を必要とするために発生していると思われます。

どちらのインターフェースも org.w3c.dom.Element を拡張し、どういうわけか Spring が axiom-dom.jar からのものを拾い上げます

おそらく axiom-dom.jar を z-axiom-dom.jar に名前変更する以外に、Spring が実行時に間違った実装を選択するのを防ぐために私ができることについてのアイデアはありますか?

com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.XWSSecurityException: java.lang.ClassCastException: org.apache.axiom.om.impl.dom.ElementImpl は javax.xml.soap.SOAPElement にキャストできません org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor.secureMessage(XwsSecurityInterceptor.java:139) で org.springframework.ws.soap.security.AbstractWsSecurityInterceptor.handleRequest(AbstractWsSecurityInterceptor.java:179) で org.springframework.ws .client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:542) で org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502) で org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive (WebServiceTemplate.java:351) org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:341) で

4

1 に答える 1

3

これは、saaj と axiom-dom の間の競合ではなく、saaj と axis2-saaj.jar の間の競合です。axis2-saaj は axiom-dom を使用しているため、例外は Axiom を参照しています。Axis2 が提供する JAX-WS 実装を使用しない場合、axis2-saaj は必要ないため、ユース ケースによっては削除することで解決できる場合があります。

于 2012-10-18T18:52:05.873 に答える