Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: org.xml.sax.SAXParseException: The root element is required in a well-formed document

  1. #11
    Join Date
    Nov 2006
    Posts
    7

    Default Same problem

    Greetings!

    I am stuck with this very same problem.
    Using WAS 6.1.0.9 (JDK compliance 5.0) and spring-ws-1.0.2.

    The server logs are just like mskendrick reports them.

    Any tips or recommendations will be greatly appreciated.
    Thanks.

  2. #12
    Join Date
    Sep 2007
    Posts
    3

    Default same problem

    We were using Spring-WS RC2 when we had the problem. The problem seems to be gone with Spring-WS 1.0.0.

  3. #13
    Join Date
    Nov 2006
    Posts
    7

    Default Nothing budged

    I just dowloaded and used Spring-WS 1.0.0 (vs. Spring-WS 1.0.2 i have been using)

    It did not change anything.

    You didn't play with the saaj-api.jar (s) by any chance as jwijgerd mentions?

    Thanks very much for your reply!

  4. #14
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    8

    Default Same thing happening for me too

    I am running into the exact same error when running under JRE 1.4 as a spring-ws client hitting my spring-ws 1.0.2 web service running under JRE 1.5 with Tomcat 5.5.

    When I use SoapUI (jre 1.5) as a client, everything works great but when I try using my JRE 1.4 client it bombs out with the same error.

    Switching from spring-ws 1.0.2 to spring-ws 1.0.0 in my JRE 1.4 client made absolutely no difference at all, still getting the same error.

    Does anyone know how to fix this?

  5. #15
    Join Date
    Nov 2006
    Posts
    7

    Default Further details

    Hello again.

    jgoober: is your client running in Websphere, and if so which version?

    My response soap is fine as per gsoap server (web service) logs. Besides, the rq/rs round trip (from my client to the server) works well when using the RAD WSDL2Java tool to generate the binding classes and proxy code. But when I use spring-ws-1.0.2 and xml-beans-2.3.0 instead the above error happens with the response payload.

    I know Arjen and others mentioned potential issues with app server vendor SAAJ implementations so i tried to override the saaj jars with no luck. I took me a while just to locate the 1.2 versions and at the end the VM did not react kindly.

    So I went the Axiom route but i am getting this (for the outbound request):
    Local name may not be null or empty
    java.lang.IllegalArgumentException: Local name may not be null or empty
    at org.apache.axiom.om.impl.llom.OMAttributeImpl.<ini t>(OMAttributeImpl.java:52)
    at org.apache.axiom.om.impl.llom.OMElementImpl.addAtt ribute(OMElementImpl.java:532)
    at org.apache.axiom.om.impl.builder.SAXOMBuilder.star tElement(SAXOMBuilder.java:111)
    at org.apache.xmlbeans.impl.store.Saver$SaxSaver.emit Element(Saver.java:3363)
    at org.apache.xmlbeans.impl.store.Saver.processElemen t(Saver.java:456)
    at org.apache.xmlbeans.impl.store.Saver.process(Saver .java:307)
    at org.apache.xmlbeans.impl.store.Saver$SaxSaver.<ini t>(Saver.java:3280)
    at org.apache.xmlbeans.impl.store.Cursor._save(Cursor .java:559)
    at org.apache.xmlbeans.impl.store.Cursor.save(Cursor. java:2508)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.save (XmlObjectBase.java:174)
    at org.springframework.oxm.xmlbeans.XmlBeansMarshalle r.marshalSaxHandlers(XmlBeansMarshaller.java:110)
    at org.springframework.oxm.AbstractMarshaller.marshal SaxResult(AbstractMarshaller.java:231)
    at org.springframework.oxm.AbstractMarshaller.marshal (AbstractMarshaller.java:94)
    at org.springframework.ws.support.MarshallingUtils.ma rshal(MarshallingUtils.java:84)
    at org.springframework.ws.client.core.WebServiceTempl ate$1.doWithMessage(WebServiceTemplate.java:267)
    Cheers.

  6. #16
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    8

    Default

    Hi geo,

    No, I am not currently using Websphere a for either the client or the server but eventually I will be using Websphere 6.1 to host the web service. I am using JAXB2 on Tomcat currently and JAXB1 on the client for the marshalling. But I don't think my issue is with the marshaller, my issue is with SAAJ 1.X running under JRE 1.4 with Spring-WS (either 1.0.0 or 1.0.2) where I am have the following stack trace on the client but no issues on the server:

    org.springframework.ws.soap.saaj.SaajSoapEnvelopeE xception: Could not access envelope: org.xml.sax.SAXParseException: Premature end of file.; nested exception is javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Premature end of file.
    Caused by: javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.SOAPPart.getEnvelope(SOAPPart.java :1005)
    at org.springframework.ws.soap.saaj.Saaj12Implementat ion.getEnvelope(Saaj12Implementation.java:141)
    at org.springframework.ws.soap.saaj.SaajSoapMessage.g etEnvelope(SaajSoapMessage.java:82)
    at org.springframework.ws.soap.AbstractSoapMessage.ge tSoapBody(AbstractSoapMessage.java:36)
    at org.springframework.ws.soap.AbstractSoapMessage.ge tPayloadSource(AbstractSoapMessage.java:46)
    at org.springframework.ws.support.MarshallingUtils.un marshal(MarshallingUtils.java:57)
    at org.springframework.ws.client.core.WebServiceTempl ate$2.extractData(WebServiceTemplate.java:267)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:408)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 256)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 244)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 236)
    at com.aa.selfservice.cne.fsn.subscription.ws.FsnSubs criptionClient.createFsnAddOn(FsnSubscriptionClien t.java:73)
    at com.aa.selfservice.cne.fsn.subscription.ws.FsnSubs criptionClientTest.main(FsnSubscriptionClientTest. java:17)
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java :101)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:701)
    at org.apache.axis.SOAPPart.getEnvelope(SOAPPart.java :1003)
    ... 12 more
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(ErrorHandlerWrap per.java:236)
    at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.fatalError(ErrorHandlerWrapper.java:215)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:384)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:314)
    at com.sun.org.apache.xerces.internal.impl.XMLVersion Detector.determineDocVersion(XMLVersionDetector.ja va:230)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:792)
    at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:758)
    at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1178)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
    ... 13 more

  7. #17
    Join Date
    Nov 2006
    Posts
    7

    Default Tried JAXB2

    Hello again,

    so i decided to go the JAXB2 route this aftenoon, just to make sure. Downloaded the jars, wrote the ant script, genned the binding types, run my client and... exact same results as previously (same as mskendrick reports).

    So this just about nails it to a SAAJ problem, what most people in this thread suspected.

    I am shutting my puter down and commencing my weekend festivities.

    Talk soon,
    /geo

  8. #18
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    8

    Default

    OK, After mucking around in the Spring-WS source (ver 1.0.2) last night, as well as reading other posts on this forum, I have determined that the differences in SAAJ implementations have not been taken completely into account in the Spring-WS source and need some attention.

    The post, linked below has a fairly good description of the problem:

    http://forum.springframework.org/sho...Premature+file

    Here are the specs for my web service and client:

    Web Service Server - Tomcat 5.5:
    - JRE 1.5
    - Spring 2.0.7
    - Spring-WS 1.0.2 + Tiger jars
    - JAXB 2
    - SAAJ 1.3

    Web Service Client- Stand Alone:
    - JRE 1.4
    - Spring 2.0.7
    - Spring-WS 1.0.2
    - JAXB 1
    - SAAJ 1.2

    Below is the output from the web service client call which fails due to an empty response (e.g. InputStream) by the time the MessageExtractor gets to it:

    SEE NEXT POST FOR THE REST...
    Last edited by jgoober; Dec 3rd, 2007 at 03:01 PM.

  9. #19
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    8

    Default

    Code:
    [2007:12:03:10:53:34:984] [main] [INFO] [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] [afterPropertiesSet] [SaajSoapMessageFactory.java] [111] [Creating SAAJ 1.2 MessageFactory]
    [2007:12:03:10:53:34:984] [main] [DEBUG] [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] [afterPropertiesSet] [SaajSoapMessageFactory.java] [134] [Using MessageFactory class [org.apache.axis.soap.MessageFactoryImpl]]
    [2007:12:03:10:53:35:015] [main] [INFO] [org.springframework.oxm.jaxb.Jaxb1Marshaller] [createJaxbContext] [Jaxb1Marshaller.java] [78] [Creating JAXBContext with context path [com.aa.selfservice.cne.fsn.subscription.ws.schema]]
    [2007:12:03:10:53:35:078] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [marshalSendAndReceive] [WebServiceTemplate.java] [261] [Entering marshalSendAndReceive(x, x, x)]
    [2007:12:03:10:53:35:078] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [marshalSendAndReceive] [WebServiceTemplate.java] [270] [Calling sendAndReceive(String, WebServiceMessageCallback, WebServiceMessageExtractor)]
    [2007:12:03:10:53:35:078] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [424] [Entering sendAndReceive(String, WebServiceMessageCallback, WebServiceMessageExtractor)]
    [2007:12:03:10:53:35:078] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [433] [Calling createConnection(uri)]
    [2007:12:03:10:53:35:078] [main] [DEBUG] [org.springframework.ws.client.support.WebServiceAccessor] [createConnection] [WebServiceAccessor.java] [106] [Opening connection to [http://127.0.0.1:8080/cne-ws/fsnsubs/services] using [org.springframework.ws.transport.http.HttpUrlConnectionMessageSender@9505f]]
    [2007:12:03:10:53:35:093] [main] [DEBUG] [org.springframework.ws.transport.http.HttpUrlConnection] [<init>] [HttpUrlConnection.java] [59] [Entering constructor HttpUrlConnection(HttpURLConnection connection)]
    [2007:12:03:10:53:35:125] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate$1] [doWithMessage] [WebServiceTemplate.java] [277] [Entering doWithMessage(WebServiceMessage request)]
    [2007:12:03:10:53:35:187] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate$1] [doWithMessage] [WebServiceTemplate.java] [289] [The requestCallback WAS null]
    [2007:12:03:10:53:35:250] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendRequest] [WebServiceTemplate.java] [595] [Sent request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <soapenv:Body>
      <ns1:CreateFsnAddOnRequest xmlns="http://www.aa.com/cne/fsn/subscriptions/schemas" xmlns:ns1="http://www.aa.com/cne/fsn/subscriptions/schemas">
       <ns1:requestHeader>
        <ns1:eventType>TestEvent01Type</ns1:eventType>
        <ns1:productType>fsn</ns1:productType>
       </ns1:requestHeader>
       <ns1:aadvantageMember>123456</ns1:aadvantageMember>
       <ns1:flight>
        <ns1:pnrLocator>DQASWED</ns1:pnrLocator>
        <ns1:departure>
         <ns1:airportCode>DFW</ns1:airportCode>
         <ns1:flightDateTime>2007-12-03T10:53:35.078-06:00</ns1:flightDateTime>
        </ns1:departure>
        <ns1:arrival>
         <ns1:airportCode>MIA</ns1:airportCode>
        </ns1:arrival>
       </ns1:flight>
       <ns1:preferences>
        <ns1:contact>
         <ns1:id>442</ns1:id>
         <ns1:name>My Cell</ns1:name>
         <ns1:address>2145447456</ns1:address>
         <ns1:protocol>V</ns1:protocol>
         <ns1:contactType>P</ns1:contactType>
        </ns1:contact>
        <ns1:settings>
         <ns1:departureStatus>true</ns1:departureStatus>
         <ns1:arrivalStatus>true</ns1:arrivalStatus>
         <ns1:connectionStatus>true</ns1:connectionStatus>
         <ns1:gateStatus>true</ns1:gateStatus>
         <ns1:notificationInterval>120</ns1:notificationInterval>
        </ns1:settings>
       </ns1:preferences>
      </ns1:CreateFsnAddOnRequest>
     </soapenv:Body>
    </soapenv:Envelope>]]
    [2007:12:03:10:53:35:265] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [447] [Calling connection.receive(MessageFactory)]
    [2007:12:03:10:53:35:265] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [51] [Entering receive(WebServiceMessageFactory)]
    [2007:12:03:10:53:35:265] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [54] [Calling onReceiveBeforeRead()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [58] [Calling createTransportInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractSenderConnection] [createTransportInputStream] [AbstractSenderConnection.java] [49] [Entering createTransportInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.AbstractHttpSenderConnection] [hasResponse] [AbstractHttpSenderConnection.java] [63] [Entering hasResponse()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.AbstractHttpSenderConnection] [hasResponse] [AbstractHttpSenderConnection.java] [73] [Response content length was 495]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractSenderConnection] [createTransportInputStream] [AbstractSenderConnection.java] [54] [The call to hasResponse() returned true]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractSenderConnection] [createTransportInputStream] [AbstractSenderConnection.java] [58] [The responseInputStream was null, creating a new ResponseTransportInputStream]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [71] [Calling createWebServiceMessage(TransportInputStream)]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [77] [Calling TransportInputStream.close()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.TransportInputStream] [close] [TransportInputStream.java] [62] [Entering close()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.TransportInputStream] [getInputStream] [TransportInputStream.java] [46] [Entering getInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.TransportInputStream] [getInputStream] [TransportInputStream.java] [51] [The inputStream WAS null]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractSenderConnection$ResponseTransportInputStream] [createInputStream] [AbstractSenderConnection.java] [118] [Calling getResponseInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.AbstractHttpSenderConnection] [getResponseInputStream] [AbstractHttpSenderConnection.java] [91] [Entering getResponseInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.AbstractHttpSenderConnection] [getResponseInputStream] [AbstractHttpSenderConnection.java] [101] [The responseBuffer WAS null, calling getRawResponseInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.HttpUrlConnection] [getRawResponseInputStream] [HttpUrlConnection.java] [140] [Entering getRawResponseInputStream()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.HttpUrlConnection] [getRawResponseInputStream] [HttpUrlConnection.java] [152] [Returning an InputStream]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.AbstractWebServiceConnection] [receive] [AbstractWebServiceConnection.java] [82] [Calling onReceiveAfterRead(WebServiceMessage)]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [453] [Calling hasFault(connection, response)]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.http.AbstractHttpSenderConnection] [hasFault] [AbstractHttpSenderConnection.java] [136] [Entering hasFault()]
    [2007:12:03:10:53:35:281] [main] [DEBUG] [org.springframework.ws.transport.TransportInputStream] [read] [TransportInputStream.java] [112] [Entering getInputStream()]
    [2007:12:03:10:53:35:296] [main] [DEBUG] [org.springframework.ws.transport.TransportInputStream] [getInputStream] [TransportInputStream.java] [46] [Entering getInputStream()]
    SEE NEXT POST FOR THE REST....
    Last edited by jgoober; Dec 3rd, 2007 at 03:00 PM.

  10. #20
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    8

    Default

    Code:
    [2007:12:03:10:53:35:296] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [logResponse] [WebServiceTemplate.java] [609] [Received response [] for request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <soapenv:Body>
      <ns1:CreateFsnAddOnRequest xmlns="http://www.aa.com/cne/fsn/subscriptions/schemas" xmlns:ns1="http://www.aa.com/cne/fsn/subscriptions/schemas">
       <ns1:requestHeader>
        <ns1:eventType>TestEvent01Type</ns1:eventType>
        <ns1:productType>fsn</ns1:productType>
       </ns1:requestHeader>
       <ns1:aadvantageMember>123456</ns1:aadvantageMember>
       <ns1:flight>
        <ns1:pnrLocator>DQASWED</ns1:pnrLocator>
        <ns1:departure>
         <ns1:airportCode>DFW</ns1:airportCode>
         <ns1:flightDateTime>2007-12-03T10:53:35.078-06:00</ns1:flightDateTime>
        </ns1:departure>
        <ns1:arrival>
         <ns1:airportCode>MIA</ns1:airportCode>
        </ns1:arrival>
       </ns1:flight>
       <ns1:preferences>
        <ns1:contact>
         <ns1:id>442</ns1:id>
         <ns1:name>My Cell</ns1:name>
         <ns1:address>2145447456</ns1:address>
         <ns1:protocol>V</ns1:protocol>
         <ns1:contactType>P</ns1:contactType>
        </ns1:contact>
        <ns1:settings>
         <ns1:departureStatus>true</ns1:departureStatus>
         <ns1:arrivalStatus>true</ns1:arrivalStatus>
         <ns1:connectionStatus>true</ns1:connectionStatus>
         <ns1:gateStatus>true</ns1:gateStatus>
         <ns1:notificationInterval>120</ns1:notificationInterval>
        </ns1:settings>
       </ns1:preferences>
      </ns1:CreateFsnAddOnRequest>
     </soapenv:Body>
    </soapenv:Envelope>]]
    [2007:12:03:10:53:35:296] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [462] [Calling responseExtractor.extractData(response) to return the result]
    [2007:12:03:10:53:35:296] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate$2] [extractData] [WebServiceTemplate.java] [298] [Entering extractData(WebServiceMessage response)]
    [2007:12:03:10:53:35:296] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate$2] [extractData] [WebServiceTemplate.java] [301] [Calling MarshallingUtils.unmarshal(getUnmarshaller(), response) to get the response]
    [2007:12:03:10:53:35:328] [main] [DEBUG] [org.springframework.ws.client.core.WebServiceTemplate] [sendAndReceive] [WebServiceTemplate.java] [488] [Calling connection.close()]
    [2007:12:03:10:53:35:328] [main] [DEBUG] [org.springframework.ws.transport.http.HttpUrlConnection] [close] [HttpUrlConnection.java] [70] [Entering close()]
    SEE NEXT POST FOR THE REST...
    Last edited by jgoober; Dec 3rd, 2007 at 03:00 PM.

Posting Permissions

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