Spring Web Services
  1. Spring Web Services
  2. SWS-175

SAAJ0511: Unable to create envelope from given source

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0.1
    • Component/s: XML
    • Labels:
      None
    • Environment:
      Tomcat 5.5.23, Sun JVM 1.6.0_01-b06

      Description

      I just encountered SAAJ0511 on Tomcat 5.5.23 with Sun JVM 1.6.0_01-b06:

      24.08.2007 16:42:51 com.sun.xml.internal.messaging.saaj.soap.EnvelopeF actory createEnvelope
      ERROR: SAAJ0511: Unable to create envelope from given source
      24.08.2007 16:42:51 com.sun.xml.internal.messaging.saaj.soap.MessageIm pl saveChanges
      ERROR: SAAJ0539: Unable to get header stream in saveChanges
      24.08.2007 16:42:51 com.sun.xml.internal.messaging.saaj.soap.MessageIm pl saveChanges
      ERROR: SAAJ0540: Error during saving a multipart message

      Servlet.service() for servlet xyz threw exception java.io.IOException
      at com.sun.xml.internal.messaging.saaj.soap.impl.Enve lopeImpl.output(EnvelopeImpl.java:298)
      at com.sun.xml.internal.messaging.saaj.soap.impl.Enve lopeImpl.output(EnvelopeImpl.java:309)
      at com.sun.xml.internal.messaging.saaj.soap.SOAPPartI mpl.getContentAsStream(SOAPPartImpl.java:305)
      at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.getHeaderBytes(MessageImpl.java:947)
      at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.saveChanges(MessageImpl.java:1098)
      at org.springframework.ws.soap.saaj.Saaj13Implementat ion.writeTo(Saaj13Implementation.java:259)
      at org.springframework.ws.soap.saaj.SaajSoapMessage.w riteTo(SaajSoapMessage.java:105)
      at org.springframework.ws.transport.AbstractWebServic eConnection.send(AbstractWebServiceConnection.java :36)
      at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:96)
      at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
      at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:158)
      at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:475)
      at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:440)

      My app's WEB-INF/lib/ contains xalan-2.7.0.jar and xercesImpl-2.8.1.jar, and I can't find potentially conflicting jars elsewhere in the tomcat installation.

      1. echo-client-webapp.tgz
        8 kB
        Ralph Pöllath
      2. jaxp-debug-log-sws-175.txt
        19 kB
        Ralph Pöllath
      3. jaxp-debug-log-sws-175-java5.txt
        19 kB
        Ralph Pöllath
      4. stacktrace-sws-175.txt
        19 kB
        Ralph Pöllath

        Activity

        Hide
        Ralph Pöllath added a comment -

        Haven't made any progress on this so far. The fact that Java 6 contains saaj, and re-packaged versions of xalan and xerces doesn't help at all.

        The IOException mentioned above is thrown by EnvelopeImpl in either output(OutputStream out) or output(OutputStream out, boolean isFastInfoset). Both methods catch Exception, and throw a new IOException, thereby re-using the cause's message, but swallowing the stacktrace. Oh well.

        "org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler" leaves me puzzled. ToXMLSAXHandler extends ToSAXHandler, which extends SerializerBase, which implements SerializationHandler. Am I looking at the wrong sources?!

        Show
        Ralph Pöllath added a comment - Haven't made any progress on this so far. The fact that Java 6 contains saaj, and re-packaged versions of xalan and xerces doesn't help at all. The IOException mentioned above is thrown by EnvelopeImpl in either output(OutputStream out) or output(OutputStream out, boolean isFastInfoset). Both methods catch Exception, and throw a new IOException, thereby re-using the cause's message, but swallowing the stacktrace. Oh well. "org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler" leaves me puzzled. ToXMLSAXHandler extends ToSAXHandler , which extends SerializerBase , which implements SerializationHandler . Am I looking at the wrong sources?!
        Hide
        Ralph Pöllath added a comment -

        Oops, looks like there is no Wiki Style Renderer for comments.

        Show
        Ralph Pöllath added a comment - Oops, looks like there is no Wiki Style Renderer for comments.
        Hide
        Arjen Poutsma added a comment -

        I can actually reproduce this using the client web app you attached. Will investigate further...

        Show
        Arjen Poutsma added a comment - I can actually reproduce this using the client web app you attached. Will investigate further...
        Hide
        Arjen Poutsma added a comment -

        I was able to fix this by removing the xerces and xalan dependencies from the pom in the echo-client-webapp. Without those, the echo client works perfectly.

        I think the problem here is that JDK 1.6 ships with JAXP 1.4, and Xerces 2.8.1 is JAXP 1.3. In the JDK 1.6 jars (rt.jar), there is a com.sun.org.apache package, which contains a SUN-specific version of Xerces and Xalan. This package implements JAXP 1.4. AFAIK, there is no Apache-provided JAXP 1.4 implementation yet.

        Show
        Arjen Poutsma added a comment - I was able to fix this by removing the xerces and xalan dependencies from the pom in the echo-client-webapp. Without those, the echo client works perfectly. I think the problem here is that JDK 1.6 ships with JAXP 1.4, and Xerces 2.8.1 is JAXP 1.3. In the JDK 1.6 jars (rt.jar), there is a com.sun.org.apache package, which contains a SUN-specific version of Xerces and Xalan. This package implements JAXP 1.4. AFAIK, there is no Apache-provided JAXP 1.4 implementation yet.
        Hide
        Arjen Poutsma added a comment -

        Closing 1.0.1 issues.

        Show
        Arjen Poutsma added a comment - Closing 1.0.1 issues.

          People

          • Assignee:
            Arjen Poutsma
            Reporter:
            Ralph Pöllath
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: