【问题标题】:Websphere SAAJ version issueWebsphere SAAJ 版本问题
【发布时间】:2013-10-11 15:17:35
【问题描述】:

我目前正在为我的应用程序使用 Tomcat 服务器,pom.xml 中的以下代码为我提供了用于 soap 1.2 协议的 SAAJ 1.3 版。但是当我们将服务器迁移到 websphere 时,我收到如下错误。

<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
    <property name="soapVersion">
        <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>
    </property>
</bean>

来自 tomcat 的控制台: 2013-10-11 11:12:51 信息 SaajSoapMessageFactory:135 - 使用 SOAP 1.2 协议创建 SAAJ 1.3 MessageFactory 2013-10-11 11:12:51 调试 SaajSoapMessageFactory:163 - 使用 MessageFactory 类 [com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl]

websphere 中的错误: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'soapVersion' 抛出异常;嵌套异常是 java.lang.IllegalArgumentException:SAAJ 1.1 和 1.2 仅支持 SOAP 1.1

我已经删除了 maven (SaajSoapMessageFactory) 生成的 jar 文件,并且从这个类中抛出了错误。

try {
            if (SaajUtils.getSaajVersion() >= SaajUtils.SAAJ_13) {
                if (!StringUtils.hasLength(messageFactoryProtocol)) {
                    messageFactoryProtocol = SOAPConstants.SOAP_1_1_PROTOCOL;
                }
                if (logger.isInfoEnabled()) {
                    logger.info("Creating SAAJ 1.3 MessageFactory with " + messageFactoryProtocol);
                }
                messageFactory = MessageFactory.newInstance(messageFactoryProtocol);
            }
            else if (SaajUtils.getSaajVersion() == SaajUtils.SAAJ_12) {
                logger.info("Creating SAAJ 1.2 MessageFactory");
                messageFactory = MessageFactory.newInstance();
            }
            else if (SaajUtils.getSaajVersion() == SaajUtils.SAAJ_11) {
                logger.info("Creating SAAJ 1.1 MessageFactory");
                messageFactory = MessageFactory.newInstance();
            }
            **else {
                **throw new IllegalStateException(
                        "SaajSoapMessageFactory requires SAAJ 1.1, which was not found on the classpath");**
            }**
        }

请告知为什么 tomcat 工作正常而 websphere 没有获得正确的 SAAJ 版本。我们也在使用 websphere 6.1.23

【问题讨论】:

    标签: java spring tomcat websphere-6.1


    【解决方案1】:

    我刚刚注意到我们在tomcat中构建的应用程序使用的是JDK1.6,但是websphere 6.1只支持jdk1.5。

    我们必须得到 websphere7。 6.x 不支持 jdk1.6

    【讨论】:

    • 是的。 WAS 6.x 已经很老了,而且已经过时了。事实上,如果 WAS 7 在明年报废,我也不会感到惊讶。您可能需要考虑大版本跳跃并一直升级到 8.x。
    • 是的,我正在阅读 ibm docs 6.1 非常旧-link
    • 当我使用 IBM Java 7 将应用程序部署到 WAS 8.5.5 时,我遇到了同样的错误。当我切换到 IBM Java 6 时,任何建议都可以正常工作
    猜你喜欢
    • 2016-04-27
    • 1970-01-01
    • 2014-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-02
    相关资源
    最近更新 更多