Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-560

IllegalStateException: Could not find SAAJ on the classpath after upgrading from 1.5.7 to 1.5.8

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.8
    • Fix Version/s: 1.5.9
    • Component/s: Core
    • Labels:
      None
    • Environment:
      saaj 1.3

      Description

      Seems there is something wrong in fix for SWS-525 (r1427 on svn), saaj version doesn't get resolved well in case where a SOAP message's envelope has a body with elements that reference a non-declared namespace/prefix like in following:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header/>
      <soapenv:Body>
      <ndns:DoSomethingRequest/>
      </soapenv:Body>
      </soapenv:Envelope>

      Such messages would previously (with SWS 1.5.7) result in SOAP Fault with Server faultcode and faultstring:

      Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:

      while now (with SWS 1.5.8) a HTTP error 500 is returned with following stack trace:

      java.lang.IllegalStateException: Could not find SAAJ on the classpath
      at org.springframework.ws.soap.saaj.SaajSoapMessage.getImplementation(SaajSoapMessage.java:261)
      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:86)
      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:727)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

      even though saaj api and impl 1.3 are on the path.

        Issue Links

          Activity

          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Applied the patch, thanks! Also kudos for finding and fixing those typos in the code and javadoc.

          I did not apply the change to WebServiceMessageReceiverObjectSupport, since that would have made the transport layer SOAP-specific, which it currently isn't. I also did not apply the detection of EndpointExceptionResolvers to AbstractWsSecurityInterceptor, for reasons explained above.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Applied the patch, thanks! Also kudos for finding and fixing those typos in the code and javadoc. I did not apply the change to WebServiceMessageReceiverObjectSupport, since that would have made the transport layer SOAP-specific, which it currently isn't. I also did not apply the detection of EndpointExceptionResolvers to AbstractWsSecurityInterceptor, for reasons explained above.
          Hide
          rhax Rahul Priyadarshi added a comment -

          I noticed that this error emanated from a trivial typo on my part.
          I had declared an element in my xsd with spaces in the beginning of its name attribute declaration.
          like : <element name= " annoyingElement" type="string"/>

          and then got exactly the same error,

          ....SEVERE: Servlet.service() for servlet spring-ws threw exception
          java.lang.IllegalStateException: Could not find SAAJ on the classpath
          at org.springframework.ws.soap.saaj.SaajSoapMessage.getImplementation(SaajSoapMessage.java:261)
          at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:84)
          at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:70)............

          and thereafter landed on this page through search engine.
          I've verified and replicated the error so i'm sure abt it now.

          Show
          rhax Rahul Priyadarshi added a comment - I noticed that this error emanated from a trivial typo on my part. I had declared an element in my xsd with spaces in the beginning of its name attribute declaration. like : <element name= " annoyingElement" type="string"/> and then got exactly the same error, ....SEVERE: Servlet.service() for servlet spring-ws threw exception java.lang.IllegalStateException: Could not find SAAJ on the classpath at org.springframework.ws.soap.saaj.SaajSoapMessage.getImplementation(SaajSoapMessage.java:261) at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:84) at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:70)............ and thereafter landed on this page through search engine. I've verified and replicated the error so i'm sure abt it now.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          @Rahul:

          Could you try a recent snapshot and see if that works better?

          Show
          arjen.poutsma Arjen Poutsma added a comment - @Rahul: Could you try a recent snapshot and see if that works better?
          Hide
          rhax Rahul Priyadarshi added a comment -

          Sorry for the delay.
          I did try the snapshot.It now has a better error reporting.
          Replicating the faulty namespace declaration and making the service call throws a clearer error description :

          ...SEVERE: Servlet.service() for servlet spring-ws threw exception
          org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
          at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333).......

          Show
          rhax Rahul Priyadarshi added a comment - Sorry for the delay. I did try the snapshot.It now has a better error reporting. Replicating the faulty namespace declaration and making the service call throws a clearer error description : ...SEVERE: Servlet.service() for servlet spring-ws threw exception org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333).......
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing old issues

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing old issues

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              sslavic Stevo Slavić
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.65h
                1.65h