Pages

Friday, June 26, 2015

Spring WS 1.5.9 issue


Our team was migrating a legacy webservice which was based on Spring WS 1.5.9 to weblogic 12.1.3.
Everything looked great and worked fine until we started stress testing. We noticed an intermittent issue with the following stack trace:

2015-06-14 10:24:42,300 DEBUG transport.http.MessageDispatcherServlet::processRequest(588)  - Could not complete request
org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not access envelope: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character (CTRL-CHAR, code 0) in prolog, after '<'.
 at [row,col {unknown-source}]: [1,2]; nested exception is javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character (CTRL-CHAR, code 0) in prolog, after '<'.
 at [row,col {unknown-source}]: [1,2]
        at org.springframework.ws.soap.saaj.support.SaajUtils.getSaajVersion(SaajUtils.java:162)
        at org.springframework.ws.soap.saaj.SaajSoapMessage.getImplementation(SaajSoapMessage.java:251)
        at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:84)
        at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:70)
        at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:168)
        at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:90)
        at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
        at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
        at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)

Turns out this is the root cause of the issue: https://jira.spring.io/browse/SWS-750

Solution: 
We upgraded to Spring-WS 2.0.4

The old app was Spring 2.0 so just took this opportunity to upgrade that to Spring 3 as well.

Final Spring lib list:

Hope this helps some one !!!