2

I am currently using Tomcat server for my application and the below code in pom.xml gives me the SAAJ version 1.3 for soap 1.2 protocol. But when we migrate the server to websphere, i am getting the error as below.

<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>

console from tomcat : 2013-10-11 11:12:51 INFO SaajSoapMessageFactory:135 - Creating SAAJ 1.3 MessageFactory with SOAP 1.2 Protocol 2013-10-11 11:12:51 DEBUG SaajSoapMessageFactory:163 - Using MessageFactory class [com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl]

Error in websphere: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'soapVersion' threw exception; nested exception is java.lang.IllegalArgumentException: SAAJ 1.1 and 1.2 only support SOAP 1.1

i have gone the jar files generated by maven (SaajSoapMessageFactory) and the error is thrown from this class.

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");**
            }**
        }

please advice why tomcat works fine and websphere not getting the right SAAJ version. Also we are using websphere 6.1.23

4

1 に答える 1

0

私たちが tomcat で構築したアプリケーションは JDK1.6 を使用していますが、websphere 6.1 は jdk1.5 しかサポートしていないことに気付きました。

websphere7 を取得する必要があります。6.x は jdk1.6 をサポートしていません

于 2013-10-11T18:26:53.480 に答える