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

Oracle Community | 807581 | 1 decade ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Strange Error when starting tomcat 5.5.7

    Oracle Community | 1 decade ago | 807581
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
  2. 0

    Tomcat does not start in Browser

    Coderanch | 8 years ago | suse singularity
    org.xml.sax.SAXParseException: Invalid encoding name "cp1252".
  3. 0

    IManager 503 Error - MicroFocusInternationalWiki

    microfocus.com | 2 years ago
    org.xml.sax.SAXParseException: Premature end of file.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The following information is printed when I try to parse an XML file saved in UTF-8 BOM format: org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) If I save the very XML file to standard UTF-8 format then everything works smoothly. I've tried to debug the source code of Xecers. I found that Xecers actually has codes that handle UTF-8 BOM formatted input stream in class org.apache.xerces.impl.XMLEntityManager.java (@version $Id: XMLEntityManager.java,v 1.94 2005/04/19 03:18:18 mrglavas Exp $). But those codes has never been executed in my case. The following is the detail: In public method setupCurrentEntity() in class XMLEntityManager, there are several lines of codes which dealing with UTF-8 BOM format input stream, and all those codes are located in the code block starting from line 929 if ( reader == null ) { .... }. The "reader" in the if clause is defined in line 923. And In my case, the reader would not be assigned a "null" value so that the codes which dealing with UTF-8 BOM would never been executed.

    Apache's JIRA Issue Tracker | 1 decade ago | lin zhu
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
  6. 0

    ICEFaces 'Content is not allowed in prolog' Error

    Stack Overflow | 8 years ago | Tam
    org.xml.sax.SAXParseException: Content is not allowed in prolog.

  1. rp 1 times, last 5 months ago
4 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.xml.sax.SAXParseException

    Content is not allowed in prolog.

    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException()
  2. Xerces2-j
    AbstractSAXParser.parse
    1. org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    2. org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    3. org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    4. org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    5. org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    6. org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
    7. org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    8. org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    9. org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    10. org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    11. org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    11 frames
  3. Glassfish Core
    Digester.parse
    1. org.apache.tomcat.util.digester.Digester.parse(Digester.java:1580)
    1 frame
  4. org.apache.catalina
    MemoryUserDatabaseFactory.getObjectInstance
    1. org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:370)
    2. org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97)
    2 frames
  5. Web Container Naming Utilities
    ResourceFactory.getObjectInstance
    1. org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129)
    1 frame
  6. Java RT
    NamingManager.getObjectInstance
    1. javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    1 frame
  7. Web Container Naming Utilities
    NamingContext.lookup
    1. org.apache.naming.NamingContext.lookup(NamingContext.java:792)
    2. org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    2 frames
  8. Embedded GlassFish Web
    GlobalResourcesLifecycleListener.lifecycleEvent
    1. org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
    2. org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:108)
    3. org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:80)
    3 frames
  9. Glassfish Core
    Catalina.start
    1. org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    2. org.apache.catalina.core.StandardServer.start(StandardServer.java:676)
    3. org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    3 frames
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:585)
    4 frames
  11. Glassfish Core
    Bootstrap.main
    1. org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    2. org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    2 frames