Announcement Announcement Module
Collapse
No announcement yet.
SAAJ0511 problem with spring-ws Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SAAJ0511 problem with spring-ws

    We have a web service application based on spring-ws.
    We have tested the application using soapUI and there is no problem.
    When we have tried to invoke a secured ws using a spring-ws client, the message seems to be correctly build

    Code:
    INFO: ==== Sending Message Start ====
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
    <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1178818329986803890945">
    <wsse:Username>user1</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">****</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <ns3:GetContractStatusRequest xmlns:ns3="http://www.zift.com/ws/sabbat" xmlns:ns4="http://www.zift.com/ws/types">
    <msisdn>21622124865</msisdn>
    </ns3:GetContractStatusRequest>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    ==== Sending Message End  ====
    but the following exception is thrown
    Code:
    590270 [org.jahia.bin.Jahia] ERROR - Throwable Exception caught in Jahia servlet : org.springframework.ws.client.core.WebServiceFaultException: Server error
    org.springframework.ws.client.core.WebServiceFaultException: Server error
            at org.springframework.ws.client.core.SimpleFaultResolver.resolveFault(SimpleFaultResolver.java:33)
            at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:201)
            at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:127)
            at com.zift.portal.services.ws.SecuredWsClientCommandImpl.InvokeWebService(SecuredWsClientCommandImpl.java:31)



    In the server-side:
    Code:
    [org.springframework.ws.server.MessageDispatcher] - MessageDispatcher with name 'messageDispatcher' received request [org.springframework.ws.soap.saaj.SaajSoapMessage@10ee5b8]
    [org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping] - Looking up endpoint for [http://www.zift.com/ws/sabbat/GetContractStatus]
    [org.springframework.ws.server.MessageDispatcher] - Endpoint mapping [org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping@98f9c2] maps request to endpoint [[email protected]1fe1e26]
    ERREUR :  'NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.'
    10 mai 2007 17:17:57 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
    GRAVE: SAAJ0511: Unable to create envelope from given source
    [org.springframework.ws.server.MessageDispatcher] - Testing endpoint exception resolver [org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver@138d2fc]
    [org.springframework.ws.server.MessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
    org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    Caused by: 
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    	at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:95)
    	at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:51)
    	at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:106)
    	at org.springframework.ws.soap.saaj.Saaj13Implementation.getEnvelope(Saaj13Implementation.java:145)
    	at org.springframework.ws.soap.saaj.SaajSoapMessage.getEnvelope(SaajSoapMessage.java:84)
    	at org.springframework.ws.soap.AbstractSoapMessage.getSoapHeader(AbstractSoapMessage.java:42)
    	at org.springframework.ws.soap.server.SoapMessageDispatcher.handleRequest(SoapMessageDispatcher.java:91)
    	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:189)
    	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:166)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handle(WebServiceMessageReceiverObjectSupport.java:78)
    	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:60)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:819)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:364)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: javax.xml.transform.TransformerException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
    	at com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:371)
    	at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:83)
    	... 30 more
    Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(Unknown Source)
    	at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(Unknown Source)
    	at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
    	at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createAttributeNS(SOAPDocumentImpl.java:142)
    	at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(Unknown Source)
    	at com.sun.xml.messaging.saaj.soap.impl.ElementImpl.setAttributeNS(ElementImpl.java:1190)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(Unknown Source)
    	at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(Unknown Source)
    	at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(Unknown Source)
    	at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startElement(Unknown Source)
    	at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
    	at com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFilter.startElement(RejectDoctypeSaxFilter.java:157)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    	at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
    	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
    	... 34 more
    Help

  • #2
    Could you try using Xerces 2.8.1 and Xalan 2.7.0 on the server-side? The com.sun.org.apache package shows that you use the Xerces and Xalan built-in to the JDK, which have some issues.

    Comment


    • #3
      Yes!
      I have added xerces and xalan on the server side and the problem was fixed.
      Thanks

      Comment


      • #4
        Originally posted by Arjen Poutsma View Post
        Could you try using Xerces 2.8.1 and Xalan 2.7.0 on the server-side? The com.sun.org.apache package shows that you use the Xerces and Xalan built-in to the JDK, which have some issues.
        I am experiencing the same exception as described in this thread. I downloaded the jars (Xerces 2.8.1 and Xalan 2.7.0). I included them in my project dependencies and I am still getting the same Error. What am I missing? I didnt install properly?

        Comment


        • #5
          Well, you have to make sure that the more recent versions are actually used. Some app servers override any JAXP libraries you provide in the WAR with their own internal versions. What app server are you running on?

          Comment


          • #6
            Tomcat, JDK 1.5

            Thank you so much for your help. I am getting pressure to move away from spring-ws and I really dont want to.

            I actually made some progress. The old versions were still being deployed in the WAR. (WEB-INF) So I removed those and I am now partially working. I can genereate the response. But it seems that I cannot parse some of the request elements. I am still getting the following error.

            Aug 21, 2007 9:46:20 AM com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
            SEVERE: SAAJ0511: Unable to create envelope from given source

            My original problem is using the generated wsdl I create a request in soapui and everything works perfectly. I have a customer that consumes the service and they generate an axis client that has a different namespace format. They both look correct but the axis client request is what produces the errors. The two different requests are below. It really looks like a namespace thing.

            If you need all of my test code I can put it up. (resource.xsd,web.xml,request handler,etc...)

            soapui:

            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loc="http://localhost">
            <soapenv:Header/>
            <soapenv:Body>
            <loc:ResourceRequest>
            <loc:requestType>update</loc:requestType>
            <loc:requestNumber>111</loc:requestNumber>
            <loc:requestingApp>updater</loc:requestingApp>
            <loc:resourceTable>Person</loc:resourceTable>
            <loc:resourceSeqId>123</loc:resourceSeqId>
            </loc:ResourceRequest>
            </soapenv:Body>
            </soapenv:Envelope>


            axis client:

            soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
            <soapenv:Header/>
            <soapenv:Body>
            <ResourceRequest xmlns="http://localhost">
            <requestType>add</loc:requestType>
            <requestNumber>123</loc:requestNumber>
            <requestingApp>updater</loc:requestingApp>
            <resourceTable>person</loc:resourceTable>
            <resourceSeqId>343</loc:resourceSeqId>
            </ResourceRequest>
            </soapenv:Body>
            </soapenv:Envelope>

            Comment


            • #7
              Well, the two XML snippets are semantically equal, so that can't be it. Are these "sniffed" from the network, using TcpMon or something similar?

              Comment


              • #8
                I'm getting the same error with Tomcat 5.5.23 on 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.

                Any ideas?

                Thanks,
                -Ralph.

                Comment


                • #9
                  Hmm, it might be a Java 6 issue. If you create a JIRA ticket, I will investigate it asap.

                  Comment


                  • #10
                    Done: SWS-175

                    Thanks,
                    -Ralph.

                    Comment


                    • #11
                      Arjen, I noticed you set the issues's fix version to 1.0.1.

                      Did you reproduce the problem? If so, could you let me know what the underlying problem is so I can start thinking about a workaround?

                      Thanks,
                      -Ralph.

                      Comment


                      • #12
                        I haven't had time to reproduce it yet. I only set the fix version to 1.0.1 because I intend to look at it before that version in released. A date for 1.0.1 has not been set yet, but I expect it to be somewhere at the end of September. Of course, the issue might be fixed beforehand, but in snapshot releases.

                        Comment


                        • #13
                          OK, thanks. Let me know if I can help somehow.

                          Comment


                          • #14
                            same problem

                            Hi,

                            I am experiencing the same problem.

                            "28-Aug-2007 10:45:05 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
                            SEVERE: SAAJ0511: Unable to create envelope from given source"

                            The versions of xalan (2.6.0) and xerces (2.6.2) war in my war file generated by mvn install. Deploying to tomcat 5.5.17 on jdk 1.5. Maven insists on downloading these versions of the file. I followed the tutorial and then ran into this problem.

                            Any pointers?

                            Comment


                            • #15
                              resolved

                              I got around this problem by changing versions of the xalan and xerces files in the war file created by maven to the following: xercesImpl-2.8.1.jar and xalan-2.7.0.jar.

                              My question is how do I get maven to include the right version of these files in the war file?

                              This seems to be a bit of a dark art in Maven2 in Maven1 it would have been easy...

                              Comment

                              Working...
                              X