Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: SAAJ0511 problem with spring-ws

  1. #1
    Join Date
    Oct 2005
    Posts
    26

    Default 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 [com.zift.ws.sabbat.webservice.endpoint.GetContractStatusEndpoint@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
    be happy :-)

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Oct 2005
    Posts
    26

    Default

    Yes!
    I have added xerces and xalan on the server side and the problem was fixed.
    Thanks
    be happy :-)

  4. #4
    Join Date
    Aug 2007
    Posts
    2

    Default

    Quote 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?

  5. #5
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  6. #6
    Join Date
    Aug 2007
    Posts
    2

    Default

    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>

  7. #7
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  8. #8

    Default

    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.

  9. #9
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Hmm, it might be a Java 6 issue. If you create a JIRA ticket, I will investigate it asap.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  10. #10

    Default

    Done: SWS-175

    Thanks,
    -Ralph.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •