GoogleSearchBox

Custom Search

Thursday, July 4, 2013

Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog.

SEVERE: Parse Fatal Error at line 2 column 1: Content is not allowed in prolog.

org.xml.sax.SAXParseException: Content is not allowed in prolog.

        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)

        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)

        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(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 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)

        at org.apache.catalina.startup.Catalina.load(Catalina.java:524)

        at org.apache.catalina.startup.Catalina.load(Catalina.java:562)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Jul 4, 2013 3:43:44 PM org.apache.catalina.startup.Catalina load

WARNING: Catalina.start using conf/server.xml:

org.xml.sax.SAXParseException: Content is not allowed in prolog.

        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)


We get this error, due to some characters in the xml file (in my case it was server.xml file) are not liked by the Parser. Even when you open the same file in IE browser, it will not open up. Also IDE like MyEclipse also shows same error "Content is not allowed in prolog."

I could not find out, which character or line are not liked by the parser.
So the solution for me : I took another same xml file (which was working) and replaced it and made changes as per my requirement.

That's it !!