Question

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

Was it helpful?

Solution

I just noticed that the application we build in tomcat is using JDK1.6 but the websphere 6.1 supports only jdk1.5.

we have to got for websphere7. 6.x dont support jdk1.6

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top