File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes  org.xml.sax.SAXParseException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark " org.xml.sax.SAXParseException" Watch " org.xml.sax.SAXParseException" New topic
Author

org.xml.sax.SAXParseException

shelly sharma
Ranch Hand

Joined: Sep 17, 2003
Posts: 32
I am using tomcat4.0,axis and xerces-2_5_0 parser.I compiled a client code.It is compiled well.But when i run that client code then a error is coming:
INFO: Mapping Exception to AxisFault
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor: null
faultDetail:
stackTrace: org.xml.sax.SAXParseException: Content is not allowed in pro
log.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa
tionContextImpl.java:213)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:457)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:362)
at org.apache.axis.client.Call.invokeEngine(Call.java:2046)
at org.apache.axis.client.Call.invoke(Call.java:2016)
at org.apache.axis.client.Call.invoke(Call.java:1786)
at org.apache.axis.client.Call.invoke(Call.java:1711)
at org.apache.axis.client.Call.invoke(Call.java:1251)
at HelloWorldClient.main(HelloWorldClient.java:33)

org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:117)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:462)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:362)
at org.apache.axis.client.Call.invokeEngine(Call.java:2046)
at org.apache.axis.client.Call.invoke(Call.java:2016)
at org.apache.axis.client.Call.invoke(Call.java:1786)
at org.apache.axis.client.Call.invoke(Call.java:1711)
at org.apache.axis.client.Call.invoke(Call.java:1251)
at HelloWorldClient.main(HelloWorldClient.java:33)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa
tionContextImpl.java:213)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:457)
... 7 more
Caught an exception: org.xml.sax.SAXParseException: Content is not allowed in pr
olog.
How can i correct this error
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Try to pick up the conversation with tcpmon or something similar. The "Content is not allowed in prolog" exception could be due to illegal characters being present in the document, or maybe a mismatch between the character set and HTTP headers.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.xml.sax.SAXParseException