org.xml.sax.SAXParseException: Document is invalid: no grammar found.

Jenkins JIRA | Mat Lowery | 4 years ago
  1. 0

    Jenkins version: 1.476 Plugin version: 2.30 My Maven build creates a cpd.xml that looks like this: <?xml version="1.0" encoding="UTF-8"?> <pmd-cpd> </pmd-cpd> And I'm seeing the following exception in the Jenkins log when the DRY plugin is enabled: org.apache.commons.digester3.Digester error SEVERE: Parse Error at line 2 column 10: Document root element "pmd-cpd", must match DOCTYPE root "null". org.xml.sax.SAXParseException: Document root element "pmd-cpd", must match DOCTYPE root "null". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(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.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester3.Digester.parse(Digester.java:1642) at org.apache.commons.digester3.Digester.parse(Digester.java:1701) at hudson.plugins.dry.parser.cpd.CpdParser.accepts(CpdParser.java:48) at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:77) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:261) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:220) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:169) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) org.apache.commons.digester3.Digester error SEVERE: Parse Error at line 2 column 10: Document is invalid: no grammar found. org.xml.sax.SAXParseException: Document is invalid: no grammar found. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(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.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester3.Digester.parse(Digester.java:1642) at org.apache.commons.digester3.Digester.parse(Digester.java:1701) at hudson.plugins.dry.parser.cpd.CpdParser.accepts(CpdParser.java:48) at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:77) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:261) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:220) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:169) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Do I need to somehow disable validation on the cpd.xml file? Or is the cpd.xml file malformed? The exception seems to occur regardless of whether the cpd.xml file contains warnings or not. Despite this exception, the plugin appears to report the correct number of duplicate code warnings. However, the exceptions are filling the Jenkins log.

    Jenkins JIRA | 4 years ago | Mat Lowery
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
  2. 0

    Jenkins version: 1.476 Plugin version: 2.30 My Maven build creates a cpd.xml that looks like this: <?xml version="1.0" encoding="UTF-8"?> <pmd-cpd> </pmd-cpd> And I'm seeing the following exception in the Jenkins log when the DRY plugin is enabled: org.apache.commons.digester3.Digester error SEVERE: Parse Error at line 2 column 10: Document root element "pmd-cpd", must match DOCTYPE root "null". org.xml.sax.SAXParseException: Document root element "pmd-cpd", must match DOCTYPE root "null". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(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.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester3.Digester.parse(Digester.java:1642) at org.apache.commons.digester3.Digester.parse(Digester.java:1701) at hudson.plugins.dry.parser.cpd.CpdParser.accepts(CpdParser.java:48) at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:77) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:261) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:220) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:169) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) org.apache.commons.digester3.Digester error SEVERE: Parse Error at line 2 column 10: Document is invalid: no grammar found. org.xml.sax.SAXParseException: Document is invalid: no grammar found. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(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.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.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) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester3.Digester.parse(Digester.java:1642) at org.apache.commons.digester3.Digester.parse(Digester.java:1701) at hudson.plugins.dry.parser.cpd.CpdParser.accepts(CpdParser.java:48) at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:77) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:261) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:220) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:169) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Do I need to somehow disable validation on the cpd.xml file? Or is the cpd.xml file malformed? The exception seems to occur regardless of whether the cpd.xml file contains warnings or not. Despite this exception, the plugin appears to report the correct number of duplicate code warnings. However, the exceptions are filling the Jenkins log.

    Jenkins JIRA | 4 years ago | Mat Lowery
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
  3. 0

    web.xml / faces-config.xml configuration issues

    Stack Overflow | 4 years ago | Glenninator
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    can't get seam-component-showcase to work with Seam 2.0.0-beta1

    Icesoft | 9 years ago | axismundi
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
  6. 0

    Error in Grails 2.3.2

    GitHub | 3 years ago | armeris
    org.xml.sax.SAXParseException: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

    8 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

      Document is invalid: no grammar found.

      at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException()
    2. Xerces2-j
      SAXParserImpl$JAXPSAXParser.parse
      1. org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      2. org.apache.xerces.util.ErrorHandlerWrapper.error(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.XMLErrorReporter.reportError(Unknown Source)
      6. org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
      7. org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
      8. org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
      9. org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
      10. org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      11. org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      12. org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      13. org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      14. org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      15. org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      16. org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      16 frames
    3. Apache Commons Digester
      Digester.parse
      1. org.apache.commons.digester3.Digester.parse(Digester.java:1642)
      2. org.apache.commons.digester3.Digester.parse(Digester.java:1701)
      2 frames
    4. hudson.plugins.dry
      DuplicationParserRegistry.parse
      1. hudson.plugins.dry.parser.cpd.CpdParser.accepts(CpdParser.java:48)
      2. hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:77)
      2 frames
    5. Static Analysis Utilities
      FilesParser.invoke
      1. hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:261)
      2. hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:220)
      3. hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:169)
      4. hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
      4 frames
    6. Hudson
      FilePath$FileCallableWrapper.call
      1. hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196)
      1 frame
    7. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.UserRequest.perform(UserRequest.java:118)
      2. hudson.remoting.UserRequest.perform(UserRequest.java:48)
      3. hudson.remoting.Request$2.run(Request.java:326)
      4. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      4 frames
    8. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      5. java.lang.Thread.run(Thread.java:662)
      5 frames