当我在weblogic中部署Web服务客户端应用程序时,遇到以下错误. [此应用程序一直在运行,tomcat中没有任何问题.]
Cannot resolve reference to bean ‘saajSoapMessageFactory’ while
setting constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘saajSoapMessageFactory’ defined in class path
resource […/core/ws/ws-config.xml]: Invocation of init method
Failed; nested exception is
org.springframework.ws.soap.soapMessageCreationException: Could not
create saaj MessageFactory: Unable to create message factory for SOAP:
weblogic.webservice.core.soap.MessageFactoryImpl cannot be cast to
javax.xml.soap.MessageFactory; nested exception is
javax.xml.soap.soAPException: Unable to create message factory for
SOAP: weblogic.webservice.core.soap.MessageFactoryImpl cannot be cast
to javax.xml.soap.MessageFactory
这是ws-config.xml中的bean定义
(bean id="saajSoapMessageFactory" class="org.springframework.ws.soap.saaj.saajSoapMessageFactory")
检查您的weblogic启动日志,您将看到一些参数设置,例如
javax.xml.rpc.ServiceFactory = weblogic.webservice.core.rpc.ServiceFactoryImpl
javax.xml.soap.MessageFactory = weblogic.webservice.core.soap.MessageFactoryImpl
您可以尝试2个选项(我不知道哪个可行,请尝试一下)
一种)
在您的客户中,将自己设置为Spring等效项
System.setProperty("javax.xml.soap.MessageFactory","org.springframework.ws.soap.saaj.saajSoapMessageFactory");
System.setProperty( "javax.xml.rpc.ServiceFactory","** Spring version **");
B)在startWeblogic.cmd中将所需版本作为-D参数传递
-Djavax.xml.soap.MessageFactory = org.springframework.ws.soap.saaj.saajSoapMessageFactory
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。