ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

春季-无法将weblogic.webservice.core.soap.MessageFactoryImpl强制转换为javax.xml.soap.MessageFactory

2019-12-02 03:29:29  阅读:430  来源: 互联网

标签:classpath weblogic spring saaj


当我在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对MessageFactoryImpl使用了它自己的默认值

检查您的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

并将saaj jars添加到weblogic的类路径中.

标签:classpath,weblogic,spring,saaj
来源: https://codeday.me/bug/20191202/2085632.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有