gpt4 book ai didi

spring - weblogic.webservice.core.soap.MessageFactoryImpl 无法转换为 javax.xml.soap.MessageFactory

转载 作者:行者123 更新时间:2023-12-02 23:46:34 25 4
gpt4 key购买 nike

当我在 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")

我尝试搜索这个问题,但不幸的是找不到任何解决方案。我在 spring 配置中缺少任何内容吗?有人以前遇到过这个问题吗?

最佳答案

我还没有遇到过这种情况 - 但发生的情况是 Weblogic 使用它自己的 MessageFactoryImpl 默认值

检查您的 weblogic 启动日志,您将看到一些参数设置,例如

javax.xml.rpc.ServiceFactory = weblogic.webservice.core.rpc.ServiceFactoryImpl
javax.xml.soap.MessageFactory = weblogic.webservice.core.soap.MessageFactoryImpl

您可以尝试 2 个选项(我不知道哪一个可行,请尝试一下)

A)

在您的客户端中,自行将这些设置为 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 jar 添加到 weblogic 类路径。

关于spring - weblogic.webservice.core.soap.MessageFactoryImpl 无法转换为 javax.xml.soap.MessageFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8210702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com