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

Exception while processing cpd report.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          dennisl Dennis Lundberg added a comment -

          We're seing this as well using Jenkins 1.470 and DRY Plugin 2.28.

          The stack trace scared a colleague because he though that his release build had failed, when in fact it had succeeded.

          Show
          dennisl Dennis Lundberg added a comment - We're seing this as well using Jenkins 1.470 and DRY Plugin 2.28. The stack trace scared a colleague because he though that his release build had failed, when in fact it had succeeded.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/dry/parser/cpd/CpdParser.java
          http://jenkins-ci.org/commit/dry-plugin/dd207d5c076d0b25138cc48d0e33e6a030f6a048
          Log:
          [FIXED JENKINS-15351] Don't validate CPD report with empty schema.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/dry/parser/cpd/CpdParser.java http://jenkins-ci.org/commit/dry-plugin/dd207d5c076d0b25138cc48d0e33e6a030f6a048 Log: [FIXED JENKINS-15351] Don't validate CPD report with empty schema.
          Hide
          dennisl Dennis Lundberg added a comment -

          I tried version 2.33 of this plugin and it solved the issue for us. Thank you!

          I noted that in the ChangeLog at https://wiki.jenkins-ci.org/display/JENKINS/DRY+Plugin the issue number for this issue is wrong. It is currently listed there as JENKINS-15354.

          Show
          dennisl Dennis Lundberg added a comment - I tried version 2.33 of this plugin and it solved the issue for us. Thank you! I noted that in the ChangeLog at https://wiki.jenkins-ci.org/display/JENKINS/DRY+Plugin the issue number for this issue is wrong. It is currently listed there as JENKINS-15354 .
          Hide
          drulli Ulli Hafner added a comment -

          Thanks. BTW: you also have the rights to modify the wiki

          Show
          drulli Ulli Hafner added a comment - Thanks. BTW: you also have the rights to modify the wiki

            People

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

              Dates

              • Created:
                Updated:
                Resolved: