PDA

View Full Version : SAAJ0511 problem with spring-ws



Hamed
May 10th, 2007, 12:17 PM
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



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


590270 [org.jahia.bin.Jahia] ERROR - Throwable Exception caught in Jahia servlet : org.springframework.ws.client.core.WebServiceFault Exception: Server error
org.springframework.ws.client.core.WebServiceFault Exception: Server error
at org.springframework.ws.client.core.SimpleFaultReso lver.resolveFault(SimpleFaultResolver.java:33)
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:201)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 127)
at com.zift.portal.services.ws.SecuredWsClientCommand Impl.InvokeWebService(SecuredWsClientCommandImpl.j ava:31)





In the server-side:


[org.springframework.ws.server.MessageDispatcher] - MessageDispatcher with name 'messageDispatcher' received request [org.springframework.ws.soap.saaj.SaajSoapMessage@1 0ee5b8]
[org.springframework.ws.server.endpoint.mapping.Abs tractMapBasedEndpointMapping] - Looking up endpoint for [http://www.zift.com/ws/sabbat/GetContractStatus]
[org.springframework.ws.server.MessageDispatcher] - Endpoint mapping [org.springframework.ws.soap.server.endpoint.mappin g.SoapActionEndpointMapping@98f9c2] maps request to endpoint [com.zift.ws.sabbat.webservice.endpoint.GetContract StatusEndpoint@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.SoapFa ultMappingExceptionResolver@138d2fc]
[org.springframework.ws.server.MessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
org.springframework.ws.soap.saaj.SaajSoapEnvelopeE xception: 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.cr eateEnvelope(EnvelopeFactory.java:95)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1 Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java :51)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEn velope(SOAPPartImpl.java:106)
at org.springframework.ws.soap.saaj.Saaj13Implementat ion.getEnvelope(Saaj13Implementation.java:145)
at org.springframework.ws.soap.saaj.SaajSoapMessage.g etEnvelope(SaajSoapMessage.java:84)
at org.springframework.ws.soap.AbstractSoapMessage.ge tSoapHeader(AbstractSoapMessage.java:42)
at org.springframework.ws.soap.server.SoapMessageDisp atcher.handleRequest(SoapMessageDispatcher.java:91 )
at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:189)
at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispatcher.java:166)
at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handle(WebServiceMes sageReceiverObjectSupport.java:78)
at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.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.p rocessRequest(FrameworkServlet.java:399)
at org.springframework.web.servlet.FrameworkServlet.d oPost(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.in ternalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invo ke(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.invok e(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.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.Trans formerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.Trans formerImpl.transform(Unknown Source)
at com.sun.xml.messaging.saaj.util.transform.Efficien tStreamingTransformer.transform(EfficientStreaming Transformer.java:371)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.cr eateEnvelope(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.CoreDocumen tImpl.createAttributeNS(Unknown Source)
at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.c reateAttributeNS(SOAPDocumentImpl.java:142)
at com.sun.org.apache.xerces.internal.dom.ElementImpl .setAttributeNS(Unknown Source)
at com.sun.xml.messaging.saaj.soap.impl.ElementImpl.s etAttributeNS(ElementImpl.java:1190)
at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2D OM.startElement(Unknown Source)
at com.sun.org.apache.xml.internal.serializer.ToXMLSA XHandler.closeStartTag(Unknown Source)
at com.sun.org.apache.xml.internal.serializer.ToSAXHa ndler.flushPending(Unknown Source)
at com.sun.org.apache.xml.internal.serializer.ToXMLSA XHandler.startElement(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unk nown Source)
at com.sun.xml.messaging.saaj.util.RejectDoctypeSaxFi lter.startElement(RejectDoctypeSaxFilter.java:157)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDispatcher.dis patch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.Trans formerImpl.transformIdentity(Unknown Source)
... 34 more


Help

Arjen Poutsma
May 11th, 2007, 05:52 AM
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.

Hamed
May 11th, 2007, 09:18 AM
Yes!
I have added xerces and xalan on the server side and the problem was fixed.
Thanks

dtreece
Aug 20th, 2007, 11:13 PM
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?

Arjen Poutsma
Aug 21st, 2007, 08:17 AM
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?

dtreece
Aug 21st, 2007, 09:04 AM
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>

Arjen Poutsma
Aug 24th, 2007, 07:50 AM
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?

ralph.poellath
Aug 24th, 2007, 10:00 AM
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.

Arjen Poutsma
Aug 24th, 2007, 10:06 AM
Hmm, it might be a Java 6 issue. If you create a JIRA ticket, I will investigate it asap.

ralph.poellath
Aug 24th, 2007, 10:13 AM
Done: SWS-175 (http://opensource.atlassian.com/projects/spring/browse/SWS-175)

Thanks,
-Ralph.

ralph.poellath
Aug 25th, 2007, 04:57 PM
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.

Arjen Poutsma
Aug 25th, 2007, 07:04 PM
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.

ralph.poellath
Aug 25th, 2007, 08:12 PM
OK, thanks. Let me know if I can help somehow.

andre.vermeulen
Aug 28th, 2007, 04:59 AM
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?

andre.vermeulen
Aug 28th, 2007, 07:05 AM
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...

ralph.poellath
Aug 28th, 2007, 08:44 AM
To change the version of a transitive dependency in Maven2, just add the dependency as a top level dependency to your project, using the desired version.

Maven2 will then find the dependency in 2 different versions and pick the one that's closest to your project (closest in terms of transitions). A dependency of a dependency is always preferred to a dependency of a dependency's dependency. By making something a top level dependency of your project, you can make sure the version matches your expectations.

Cheers,
-Ralph.

andre.vermeulen
Aug 28th, 2007, 08:51 AM
Yes,

That's exactly what I ended up doing...

It might be helpfull to add the following 2 dependencies to the pom.xml of the Spring-WS tutorial.

<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>

Paul Nyheim
Feb 14th, 2008, 06:34 AM
I have the last couple of days experienced the problem of:


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


I could not find any simple answer to this on google, so I thought I should share with you the solution in my case which was very simple, but nonetheless extremely hard to find. :)

I had forgotten to include


<xs:schema ... elementFormDefault="qualified">

in my XML Schema.

Sincerely,
Paul

justin.crow
Oct 29th, 2008, 06:35 AM
Yes,

That's exactly what I ended up doing...

It might be helpfull to add the following 2 dependencies to the pom.xml of the Spring-WS tutorial.

<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>

Thanks Andre - that worked a treat after a few hours of frustration!

creme-fresh
Jan 12th, 2009, 07:32 AM
Hello,

I'm using Grails with the Grails-metro-plugin 1.0.2 which comes with jaxws-spring 1.8. I deployed a service and the WSDL can be requested, but the following error occur, when I call the service:

SCHWERWIEGEND: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.

The recent xalan and xerces builds are in my Grails/lib directory. Does anyone knows what's on here?

-thanks

creme-fresh
Jan 13th, 2009, 07:04 PM
played a little:

when I delete all my controllers the services work ...,

but when I create one the services fail.

Are they fighting against each other ??? :confused:

creme-fresh
Jan 14th, 2009, 08:14 AM
resolved by:
- deleting grails.mime.types xml part in the config.groovy
- changing urlmappings to

class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
controller(matches:/.*[^(services)].*/)
}
}
"500"(view:'/error')
}
}

kasi
Apr 2nd, 2009, 04:03 PM
Hello Ralph, Arjen

I have read your trail of posts regarding SAAJ0511 error code.

I am trying out my first Spring-Ws and seem to have hit the problem
straightaway . When I use TcpMon, The request goes out correctly , but
the response falls over because of the above error code.

I am running my test class in Eclipse, and my JRE is 1.6.0_12 -

My client pom.xml does nt have any entries for xalan and xerces but somehow xalan version 2.6.0 and xercesImpl 2.6.2 jars get put in. Think it is a transitive dependency.

version of other jars are :

spring - 2.5.6
maven - 2.0.9
spring-ws - 1.5.6
jaxen - 1.1
saaj-api - 1.3
saaj-impl - 1.3

I am running this on tomcat 6.0.16 .

Please find snippet of error logs below. Any help greatly appreciated. I am going around in circles playing with jars, and jre's for the last 8 hours. :(


02-Apr-2009 21:43:20 org.springframework.xml.xsd.commons.CommonsXsdSche maCollection afterPropertiesSet
INFO: Loaded URL [file:/E:/tomcat6/webapps/ecaptain/WEB-INF/classes/spring-ws-xsd/hr.xsd],URL [file:/E:/tomcat6/webapps/ecapt
ain/WEB-INF/classes/spring-ws-xsd/hr-response.xsd]
02-Apr-2009 21:43:21 org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory afterPropertiesSet
INFO: Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
02-Apr-2009 21:43:21 org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'springws': initialization completed in 1141 ms
02-Apr-2009 21:43:21 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
02-Apr-2009 21:49:05 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
02-Apr-2009 21:49:32 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source

Thanks

Kasi

kasi
Apr 3rd, 2009, 03:42 AM
Hello Ralph, Arjen

I have read your trail of posts regarding SAAJ0511 error code.

I am trying out my first Spring-Ws and seem to have hit the problem
straightaway . When I use TcpMon, The request goes out correctly , but
the response falls over because of the above error code.

I am running my test class in Eclipse, and my JRE is 1.6.0_12 -

My client pom.xml does nt have any entries for xalan and xerces but somehow xalan version 2.6.0 and xercesImpl 2.6.2 jars get put in. Think it is a transitive dependency.

version of other jars are :

spring - 2.5.6
maven - 2.0.9
spring-ws - 1.5.6
jaxen - 1.1
saaj-api - 1.3
saaj-impl - 1.3

I am running this on tomcat 6.0.16 .

Please find snippet of error logs below. Any help greatly appreciated. I am going around in circles playing with jars, and jre's for the last 8 hours.


02-Apr-2009 21:43:20 org.springframework.xml.xsd.commons.CommonsXsdSche maCollection afterPropertiesSet
INFO: Loaded URL [file:/E:/tomcat6/webapps/ecaptain/WEB-INF/classes/spring-ws-xsd/hr.xsd],URL [file:/E:/tomcat6/webapps/ecapt
ain/WEB-INF/classes/spring-ws-xsd/hr-response.xsd]
02-Apr-2009 21:43:21 org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory afterPropertiesSet
INFO: Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
02-Apr-2009 21:43:21 org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'springws': initialization completed in 1141 ms
02-Apr-2009 21:43:21 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
02-Apr-2009 21:49:05 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source
02-Apr-2009 21:49:32 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source

Thanks

Kasi

mfirry
Feb 16th, 2012, 03:49 AM
Hi,
i've got this SAAJ0511: Unable to create envelope from given source too.

i'm trying to build up a spring-ws client.

my pojo were created using org.apache.cxf - cxf-codegen-plugin (version 2.5.2).

i'm using spring-ws 2.0.4.RELEASE

i get this exception just by running a simple junit test.

my configuration is very simple

<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="commerce.connect" />
</bean>

<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory" />

I can't really put my hands on the server side. :(

good141
Feb 17th, 2012, 04:29 AM
I have added xerces and xalan on the server side and the problem was fixed.
4689

kritiana0
Feb 24th, 2012, 04:24 AM
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?

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?

__________________
download 5000 backlinks (http://bit.ly/z2Rie5)

lucasHey
Mar 2nd, 2012, 07:58 AM
Thanks! Adding Xerces 2.8.1 an Xalan 2.7.0 does actually work! I'm not getting the exception anymore after days of moving in circles!

michael.wang
Jul 31st, 2012, 08:41 AM
If you are using jaxen, you can also fix it by excluding xom in you maven .pom file:
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
</exclusion>
</exclusions>
</dependency>