org.xml.sax.SAXParseException: File "common.ent" not found.

QOS.ch JIRA | daniel.ruiqing.wang | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    An exception occur saying the external entity file could not be found even actually the file put in the correct path. I try to parse the logback.xml with w3c dom. the xml could be parsed. that means the path of the external entity file is correct. Exception message: Failed to auto configure default logger context Reported exception: ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors. at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:67) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:134) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:141) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) at com.kingland.independence.Test.main(Test.java:9) Caused by: org.xml.sax.SAXException: Stopping after fatal error: File "common.ent" not found. at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1245) at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntity(DefaultEntityHandler.java:780) at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromParameterEntity(DefaultEntityHandler.java:703) at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromEntity(DefaultEntityHandler.java:588) at org.apache.xerces.framework.XMLDTDScanner.scanDecls(XMLDTDScanner.java:1498) at org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java:1123) at org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentScanner.java:2145) at org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.java:2100) at org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(XMLDocumentScanner.java:831) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098) at javax.xml.parsers.SAXParser.parse(SAXParser.java:392) at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:61) ... 13 more 17:36:36,538 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 17:36:36,538 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/C:/Development/Hub/Master/Independence/Independence/webApplication/WEB-INF/classes/logback-test.xml] 17:36:36,881 |-ERROR in ch.qos.logback.core.joran.event.SaxEventRecorder@2c54366 - XML_PARSING - Parsing fatal error on line 0 and column 0 org.xml.sax.SAXParseException; systemId: ; lineNumber: 0; columnNumber: 0; File "common.ent" not found. at org.xml.sax.SAXParseException: File "common.ent" not found. at at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219) at at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntity(DefaultEntityHandler.java:780) at at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromParameterEntity(DefaultEntityHandler.java:703) at at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromEntity(DefaultEntityHandler.java:588) at at org.apache.xerces.framework.XMLDTDScanner.scanDecls(XMLDTDScanner.java:1498) at at org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java:1123) at at org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentScanner.java:2145) at at org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.java:2100) at at org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(XMLDocumentScanner.java:831) at at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098) at at javax.xml.parsers.SAXParser.parse(SAXParser.java:392) at at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:61) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:134) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:141) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) at at com.kingland.independence.Test.main(Test.java:9) ----------------------------------------------------------------------------------------- My test code: package com.kingland.independence; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Test { public static void main(String[] args) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse("C:\\Development\\Hub\\Master\\Independence\\Independence\\webApplication\\WEB-INF\\classes\\logback.xml"); NodeList nodes = doc.getElementsByTagName("pattern"); for (int i = 0; i < nodes.getLength(); i++){ Node node = nodes.item(i); System.out.println(node.getFirstChild().getNodeValue()); } } } ----------------------------------------------------------------------------------------- My logback.xml file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration[ <!ENTITY % common SYSTEM "common.ent"> %common; ]> <!-- used for BVT/UAT/PROD environment, will not include debug information and print in console --> <configuration scan="true"> <conversionRule conversionWord="crlf" converterClass="org.owasp.security.logging.mask.CRLFConverter" /> <include resource="logback-common.xml" /> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>ERROR</level> </filter> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%d{&LOGGING_DATE_PATTERN; &LOGGING_TIME_PATTERN;}{&LOGGING_TIME_ZONE;} [%thread] [%marker] %-5level %logger{36} throwable{full} - %crlf(%msg) %n</pattern> </layout> </appender> <root level="INFO"> <appender-ref ref="Console" /> <appender-ref ref="IndyLogFile" /> </root> </configuration>

    QOS.ch JIRA | 2 years ago | daniel.ruiqing.wang
    org.xml.sax.SAXParseException: File "common.ent" not found.
  2. 0

    SAXParseException with AXIS Webservice Framework

    Stack Overflow | 4 years ago | tiger
    org.xml.sax.SAXParseException: The root element is required in a well-formed document.
  3. 0

    Tomcat 3.2.3 web.xml error

    Google Groups | 1 decade ago | Rogelio
    org.xml.sax.SAXParseException: The content of elements must consist of well-form ed character data or markup.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    db:: 2.98::StremCorrupted Exception reading on an object c8

    hivmr.com | 1 year ago
    org.xml.sax.SAXParseException: The entity "content_ppov_1704781_1091806592456" was referenced, but not declared.
  6. 0

    Installation error in Linux

    openbravo | 1 decade ago | nagusi
    org.xml.sax.SAXParseException: Element type "listener" must be declared.

    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

      File "common.ent" not found.

      at org.apache.xerces.framework.XMLParser.reportError()
    2. org.apache.xerces
      XMLParser.parse
      1. org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219)
      2. org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntity(DefaultEntityHandler.java:780)
      3. org.apache.xerces.readers.DefaultEntityHandler.startReadingFromParameterEntity(DefaultEntityHandler.java:703)
      4. org.apache.xerces.readers.DefaultEntityHandler.startReadingFromEntity(DefaultEntityHandler.java:588)
      5. org.apache.xerces.framework.XMLDTDScanner.scanDecls(XMLDTDScanner.java:1498)
      6. org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java:1123)
      7. org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentScanner.java:2145)
      8. org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.java:2100)
      9. org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(XMLDocumentScanner.java:831)
      10. org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
      11. org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
      11 frames
    3. Java RT
      SAXParser.parse
      1. javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
      1 frame
    4. Logback Core Module
      GenericConfigurator.doConfigure
      1. ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:61)
      2. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:134)
      3. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
      4. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
      4 frames
    5. Logback Classic Module
      ContextInitializer.autoConfig
      1. ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
      2. ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
      2 frames
    6. SLF4J LOG4J-12 Binding
      StaticLoggerBinder.<clinit>
      1. org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
      2. org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
      2 frames
    7. SLF4J API Module
      LoggerFactory.getLogger
      1. org.slf4j.LoggerFactory.bind(LoggerFactory.java:141)
      2. org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120)
      3. org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331)
      4. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283)
      5. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304)
      5 frames
    8. com.kingland.independence
      Test.main
      1. com.kingland.independence.Test.main(Test.java:9)
      1 frame