Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15351

Exception while processing cpd report.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • dry-plugin
    • None

      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.

            drulli Ulli Hafner
            mlowery Mat Lowery
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: