com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl无法转换为oracle.j2ee.ws.saaj.soap.MessageImpl [英] com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to oracle.j2ee.ws.saaj.soap.MessageImpl
问题描述
我遇到以下错误:
Exception: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to oracle.j2ee.ws.saaj.soap.MessageImpl
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:234)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:141)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:134)
我的代码是:
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
soapMessage.getSOAPPart().getEnvelope().addNamespaceDeclaration("http://action.web.nnn.some.com/", "act");
SOAPElement elemement = soapMessage.getSOAPPart().getEnvelope().getBody().addChildElement("getSomeMethod", "http://action.web.nnn.some.com/").addChildElement("arg0");
elemement.addTextNode(someDate);
soapMessage.saveChanges();
SOAPMessage responce = SOAPConnectionFactory.newInstance().createConnection().call(soapMessage, wsdlUrl);
运行在以下位置的应用程序:
The application running under:
-
Java(TM)SE运行时环境(内部版本1.7.0_15-b33)
Java(TM) SE Runtime Environment (build 1.7.0_15-b33)
WebLogic Server 12.1.2.0.0
WebLogic Server 12.1.2.0.0
将以下行添加到setDomainEnv后出现错误:
The error appeared after adding the following line into setDomainEnv:
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
我正在尝试将SAAj的实现切换到saaj-impl-1.3.23.jar.
I am trying to switch implementation of SAAj to saaj-impl-1.3.23.jar.
我的问题是:如何正确地要求Weblogic使用提供的SAAJ实现而不是它自己的实现?
My question is: how to properly ask Weblogic to use provided SAAJ implementation instead of its own?
推荐答案
这个问题经常被问到,答案是告诉weblogic在您的weblogic/application.xml文档中应该使用哪个版本:
This question gets asked often, the answer is to tell weblogic what version it should prefer in your weblogic/application.xml document:
<wls:prefer-application-packages>
<wls:package-name>com.sun.xml.messaging.saaj.*</wls:package-name>
</wls:prefer-application-packages>
这将迫使weblogic在您的耳朵APP-INF/lib目录中使用saaj软件包.在此处
That will force weblogic to use the saaj package in your ear APP-INF/lib directory. Check the Oracle docs here
另请参阅:
Weblogic配置-Preferred-web-inf-classes
这篇关于com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl无法转换为oracle.j2ee.ws.saaj.soap.MessageImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!