无法将weblogic.webservice.core.soap.MessageFactoryImpl强制转换为javax.xml.soap.MessageFactory [英] weblogic.webservice.core.soap.MessageFactoryImpl cannot be cast to javax.xml.soap.MessageFactory
问题描述
当我在weblogic中部署Web服务客户端应用程序时,遇到以下错误. [此应用程序一直在运行,tomcat中没有任何问题.]
I am stuck with the following error when I deploy my web-services client application in weblogic. [This application has been working without any issues in tomcat.]
在以下情况下无法解析对bean'saajSoapMessageFactory'的引用 设置构造函数参数;嵌套的异常是 org.springframework.beans.factory.BeanCreationException:错误 创建在类路径中定义的名称为"saajSoapMessageFactory"的bean 资源[.../core/ws/ws-config.xml]:调用init方法 失败的;嵌套的异常是 org.springframework.ws.soap.SoapMessageCreationException:无法 创建SAAJ MessageFactory:无法为SOAP创建消息工厂: 无法将weblogic.webservice.core.soap.MessageFactoryImpl强制转换为 javax.xml.soap.MessageFactory;嵌套的异常是 javax.xml.soap.SOAPException:无法为以下消息创建消息工厂 SOAP:无法强制转换weblogic.webservice.core.soap.MessageFactoryImpl 到javax.xml.soap.MessageFactory
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定义
Here is the bean definition in ws-config.xml
(bean id="saajSoapMessageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory")
我尝试搜索此问题,但不幸的是找不到任何解决方案.我在春季配置中缺少任何东西吗?以前有人遇到过这个问题吗?
I tried searching for this issue, but unfortunately could not find any solution. Am I missing anything in the spring config? Has any one faced this issue before?
推荐答案
我还没有遇到过-但是发生的是Weblogic对MessageFactoryImpl使用了它自己的默认值
I've not come across this - but what's happening is that Weblogic uses it's own default for the MessageFactoryImpl
检查您的weblogic启动日志,您将看到一些参数设置,例如
Check your weblogic startup logs and you will see some parameters set such as
javax.xml.rpc.ServiceFactory = weblogic.webservice.core.rpc.ServiceFactoryImpl
javax.xml.soap.MessageFactory = weblogic.webservice.core.soap.MessageFactoryImpl
您可以尝试2个选项(我不知道哪个可行,请尝试一下)
You can try 2 options (I dont know which will work, try it out)
A)
在您的客户端中,将您自己设置为Spring等效项
In your client, set these yourself to the Spring equivalents
System.setProperty("javax.xml.soap.MessageFactory", "org.springframework.ws.soap.saaj.SaajSoapMessageFactory");
System.setProperty( "javax.xml.rpc.ServiceFactory", "** Spring version **");
B)在startWeblogic.cmd
B) Pass your required version as a -D
parameter in the startWeblogic.cmd
-Djavax.xml.soap.MessageFactory=org.springframework.ws.soap.saaj.SaajSoapMessageFactory
并将saaj jars添加到weblogic的类路径中.
and add saaj jars to the weblogic classpath.
这篇关于无法将weblogic.webservice.core.soap.MessageFactoryImpl强制转换为javax.xml.soap.MessageFactory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!