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

sbsekar
  • 67
  • 2
  • 12

1 Answers1

0

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

sbsekar
  • 67
  • 2
  • 12
  • Yes. WAS 6.x is very old, and past end of life. In fact, it wouldn't surprise me if WAS 7 reached end of life in the next year. You might want to consider a big version jump and get all the way up to 8.x. – Ian McLaird Oct 11 '13 at 19:01
  • yes i was going through the ibm docs 6.1 is very old- [link](http://www-01.ibm.com/support/docview.wss?uid=swg27005002) – sbsekar Oct 11 '13 at 19:08
  • 1
    I am getting the same error when i deploy the application to WAS 8.5.5 with IBM java 7. When i switch to IBM Java 6 it works fine any suggestions – Shravan Ramamurthy Sep 29 '16 at 14:18