You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ramya Manian <ra...@persistent.co.in> on 2004/07/01 07:08:08 UTC

"Content is not allowed in prolog" exception

Hi

I get a SAX parser exception as "Content is not allowed in prolog"
while parsing the response. I have included the response that I
receive from the server and the stack trace of the exception. Also
there are no junk characters before or after the response.

Can someone please explain what can cause this exception? Is anything
wrong in the response?

This is a repost as there were no replies for the earlier one. I need to get
this working ASAP.

Thanks
Ramya

RESPONSE
----------
HTTP/1.1 200 OK Accept: application/soap+xml, application/dime,
multipart/related, text/* Cache-Control: no-cache Content-Type: text/xml;
charset="UTF-8" Host: 127.0.0.1 Pragma: no-cache User-Agent: enlistSrv
Content-Length: 728
<?xml version="1.0" encoding="UTF-8"?>
   <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.w3.org/2001/XMLSchema"
E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <E:Body>
         <m:ConnectResponse xmlns:m="http://www.PersistentData.com/enList">
            <m:connectionid s:type="y:int">3</m:connectionid>
            <m:result>
               <m:resultCode s:type="y:int">0</m:resultCode>
               <m:errorCode s:type="y:int">0</m:errorCode>
               <m:errorMessage s:type="y:string"></m:errorMessage>
               <m:diagonsticMessage s:type="y:string"></m:diagonsticMessage>
               <m:size s:type="y:int">0</m:size>
            </m:result>
         </m:ConnectResponse>
      </E:Body>
   </E:Envelope>


STACKTRACE
----------
" org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:562)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2600)
        at org.apache.axis.client.Call.invoke(Call.java:2565)
        at org.apache.axis.client.Call.invoke(Call.java:2254)
        at org.apache.axis.client.Call.invoke(Call.java:2177)
        at org.apache.axis.client.Call.invoke(Call.java:1694)
        at
com.PersistentData.www.enList.ServiceBindingStub.connect(ServiceBindingStub.java
:312)
        at Client.main(Client.java:32)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerW
rapper.ja
va:236)
        at
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:2
15)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:314)
        at
org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocum
entScanne
rImpl.java:857)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFr
agmentSca
nnerImpl.java:338)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:828)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:758)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1178)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContext
Impl.java
:272)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:554)
        ... 8 more
"


Re: "Content is not allowed in prolog" exception

Posted by "NJ Rogers, Learning and Research Technology" <Ni...@bristol.ac.uk>.
Hi

It's a prob I've had before & to do with the leading xml declaration
see e.g.

http://java2.5341.com/msg/44393.html

- a case which might have something in common with yours?

Nikki

--On Thursday, July 01, 2004 10:38:08 +0530 Ramya Manian 
<ra...@persistent.co.in> wrote:

> Hi
>
> I get a SAX parser exception as "Content is not allowed in prolog"
> while parsing the response. I have included the response that I
> receive from the server and the stack trace of the exception. Also
> there are no junk characters before or after the response.
>
> Can someone please explain what can cause this exception? Is anything
> wrong in the response?
>
> This is a repost as there were no replies for the earlier one. I need to
> get this working ASAP.
>
> Thanks
> Ramya
>
> RESPONSE
> ----------
> HTTP/1.1 200 OK Accept: application/soap+xml, application/dime,
> multipart/related, text/* Cache-Control: no-cache Content-Type: text/xml;
> charset="UTF-8" Host: 127.0.0.1 Pragma: no-cache User-Agent: enlistSrv
> Content-Length: 728
> <?xml version="1.0" encoding="UTF-8"?>
>    <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:y="http://www.w3.org/2001/XMLSchema"
> E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>       <E:Body>
>          <m:ConnectResponse
> xmlns:m="http://www.PersistentData.com/enList">
> <m:connectionid s:type="y:int">3</m:connectionid>
>             <m:result>
>                <m:resultCode s:type="y:int">0</m:resultCode>
>                <m:errorCode s:type="y:int">0</m:errorCode>
>                <m:errorMessage s:type="y:string"></m:errorMessage>
>                <m:diagonsticMessage
> s:type="y:string"></m:diagonsticMessage>                <m:size
> s:type="y:int">0</m:size>
>             </m:result>
>          </m:ConnectResponse>
>       </E:Body>
>    </E:Envelope>
>
>
> STACKTRACE
> ----------
> " org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:562)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2600)
>         at org.apache.axis.client.Call.invoke(Call.java:2565)
>         at org.apache.axis.client.Call.invoke(Call.java:2254)
>         at org.apache.axis.client.Call.invoke(Call.java:2177)
>         at org.apache.axis.client.Call.invoke(Call.java:1694)
>         at
> com.PersistentData.www.enList.ServiceBindingStub.connect(ServiceBindingSt
> ub.java :312)
>         at Client.main(Client.java:32)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in
> prolog.         at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorH
> andlerW rapper.ja
> va:236)
>         at
> org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper
> .java:2 15)
>         at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java
> :384)         at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java
> :314)         at
> org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
>         at
> org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(X
> MLDocum entScanne
> rImpl.java:857)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDoc
> umentFr agmentSca
> nnerImpl.java:338)
>         at
> org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.jav
> a:828)         at
> org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.jav
> a:758)         at
> org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)         at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
> 1178)         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at
> org.apache.axis.encoding.DeserializationContextImpl.parse(Deserialization
> Context Impl.java
> :272)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:554)
>         ... 8 more
> "
>



----------------------
NJ Rogers, Technical Researcher
(Semantic Web Applications Developer)
Institute for Learning and Research Technology (ILRT)
Email:nikki.rogers@bristol.ac.uk
Tel: +44(0)117 9287096 (Direct)
Tel: +44(0)117 9287193 (Office)