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

Both DryPublisher and PmdPublisher abort due to exception

      I am running Jenkins 1.486 on an OpenSUSE linux with various plugins (see attached System_Info.pdf for full list). I have 2 Windows slaves attached on which I run FLEX build/analysis/unit-test/flexcover. For the static analysis, I use FlexPMD which produces pmd.xml and cpd.xml files. Whenever I try to publish either of these files, I get an exception with basically the same stack trace in either case. It does not matter if I use one, or the other (or both), I get a build failure because of the exception. When I do not use either, the build is successful.

      I am using the DRY (v2.33) publisher and PMD (v3.33) publisher plugins, with the analysis-collector (v1.34) and analysis-core (v1.48).

      The DRY publisher plugin gives the following error
      [DRY] Collecting duplicate code analysis files...
      ERROR: Publisher hudson.plugins.dry.DryPublisher aborted due to exception

      The PMD publisher plugin gives the following error
      [PMD] Collecting PMD analysis files...
      ERROR: Publisher hudson.plugins.pmd.PmdPublisher aborted due to exception

      The following stack trace follows either error:
      [DRY] Collecting duplicate code analysis files...
      ERROR: Publisher hudson.plugins.dry.DryPublisher aborted due to exception

      [PMD] Collecting PMD analysis files...
      ERROR: Publisher hudson.plugins.pmd.PmdPublisher aborted due to exception

      hudson.util.IOException2: remote file operation failed: d:\views\jenkins\workspace\KH_............._efx at hudson.remoting.Channel@512c512c:Slave Windows-HW-10.X.Y.Z
      at hudson.FilePath.act(FilePath.java:847)
      at hudson.FilePath.act(FilePath.java:824)
      at hudson.plugins.pmd.PmdPublisher.perform(PmdPublisher.java:139)
      at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:144)
      at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:329)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729)
      at hudson.model.Run.execute(Run.java:1541)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      Caused by: java.io.IOException: Remote call on Slave Windows-HW-10.244.160.82 failed
      at hudson.remoting.Channel.call(Channel.java:673)
      at hudson.FilePath.act(FilePath.java:840)
      ... 13 more
      Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
      at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
      at org.apache.commons.digester.Digester.getFactory(Digester.java:490)
      at org.apache.commons.digester.Digester.getParser(Digester.java:693)
      at org.apache.commons.digester.Digester.getXMLReader(Digester.java:899)
      at org.apache.commons.digester.Digester.parse(Digester.java:1666)
      at hudson.plugins.pmd.parser.PmdParser.parse(PmdParser.java:70)
      at hudson.plugins.analysis.core.AbstractAnnotationParser.parse(AbstractAnnotationParser.java:53)
      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:2308)
      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(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:60)
      at java.lang.Thread.run(Unknown Source)

          [JENKINS-15593] Both DryPublisher and PmdPublisher abort due to exception

          Ulli Hafner added a comment -

          Since the error is from the slave node I need some more information from your slave. What JDK are use using on the slaves? Typically, the class org.apache.xerces.jaxp.SAXParserFactoryImpl should be available on your slave.

          How do you connect your slaves with the master?

          Ulli Hafner added a comment - Since the error is from the slave node I need some more information from your slave. What JDK are use using on the slaves? Typically, the class org.apache.xerces.jaxp.SAXParserFactoryImpl should be available on your slave. How do you connect your slaves with the master?

          Ulli Hafner added a comment -

          BTW: you can run the analysis on your master by copying the results (pmd.xml and cpd.xml) to the master node and running a new job that does only analyse these files (just as a workaround).

          Ulli Hafner added a comment - BTW: you can run the analysis on your master by copying the results (pmd.xml and cpd.xml) to the master node and running a new job that does only analyse these files (just as a workaround).

          Ulli Hafner added a comment -

          Can you please also have a look at the comments from JENKINS-14689?

          Ulli Hafner added a comment - Can you please also have a look at the comments from JENKINS-14689 ?

          Bob Ballantyne added a comment - - edited

          I have one slave with:
          java version "1.6.0_26"
          Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
          Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

          the other uses:
          java version "1.6.0_35"
          Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
          Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing)
          The issue occurs on both.

          I connect both slaves to the master using slave-agent.jnlp

          I did copy the pmd.xml and cpd.xml to the master, configured a new job which only published these files. PMD publishing was successful, while parsing cpd.xml was not giving the following exception (which I have seen previously):

          Building on master in workspace /var/lib/jenkins/workspace/pmd-test
          [PMD] Collecting PMD analysis files...
          [PMD] Finding all files that match the pattern reports/pmd.xml
          [PMD] Parsing 1 files in /var/lib/jenkins/workspace/pmd-test
          [PMD] Successfully parsed file /var/lib/jenkins/workspace/pmd-test/reports/pmd.xml of module with 2269 warnings.
          [DRY] Collecting duplicate code analysis files...
          [DRY] Finding all files that match the pattern reports/cpd.xml
          [DRY] Parsing 1 files in /var/lib/jenkins/workspace/pmd-test
          [DRY] Parsing of file /var/lib/jenkins/workspace/pmd-test/reports/cpd.xml failed due to an exception:

          java.io.IOException: No parser found for duplicated code results file /var/lib/jenkins/workspace/pmd-test/reports/cpd.xml
          at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:93)
          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.act(FilePath.java:851)
          at hudson.FilePath.act(FilePath.java:824)
          at hudson.plugins.dry.DryPublisher.perform(DryPublisher.java:175)
          at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:144)
          at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:329)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729)
          at hudson.model.Run.execute(Run.java:1541)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:236)

          (FYI: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.class is in the CLASSPATH because it is in the SUN rt.jar, but not what we are looking for.)

          I have only one jar (xercesImpl.jar) in the PATH, which implements org.apache.xerces.jaxp.SAXParserFactoryImpl.
          I created the folder "c:\Program Files\Java\jre6\lib\endorsed\" and copied that jar into it. Now PMD publishing runs successfully.

          Copy/Paste detection publishing (DRY) again fails with the following error on the slave console:
          Oct 23, 2012 3:40:34 PM com.youdevise.hudson.slavestatus.SlaveListener call
          INFO: Slave-status listener starting
          Oct 23, 2012 3:40:34 PM com.youdevise.hudson.slavestatus.SocketHTTPListener waitForConnection
          INFO: Slave-status listener ready on port 3141
          Oct 23, 2012 3:40:45 PM org.apache.commons.digester3.Digester getParser
          SEVERE: Digester.getParser:
          java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
          at javax.xml.parsers.SAXParserFactory.setXIncludeAware(Unknown Source)
          at org.apache.commons.digester3.Digester.getFactory(Digester.java:439)
          at org.apache.commons.digester3.Digester.getParser(Digester.java:652)
          at org.apache.commons.digester3.Digester.getXMLReader(Digester.java:799)
          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:2308)
          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(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:60)
          at java.lang.Thread.run(Unknown Source)

          And the Jenkins log shows:
          [DRY] Collecting duplicate code analysis files...
          ERROR: Publisher hudson.plugins.dry.DryPublisher aborted due to exception
          java.lang.NullPointerException
          at org.apache.commons.digester3.Digester.getXMLReader(Digester.java:799)
          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:2308)
          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(Unknown Source)
          at java.util.concurrent.FutureTask.run(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at hudson.remoting.Engine$1$1.run(Engine.java:60)
          at java.lang.Thread.run(Unknown Source)

          Bob Ballantyne added a comment - - edited I have one slave with: java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) the other uses: java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10) Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing) The issue occurs on both. I connect both slaves to the master using slave-agent.jnlp I did copy the pmd.xml and cpd.xml to the master, configured a new job which only published these files. PMD publishing was successful, while parsing cpd.xml was not giving the following exception (which I have seen previously): Building on master in workspace /var/lib/jenkins/workspace/pmd-test [PMD] Collecting PMD analysis files... [PMD] Finding all files that match the pattern reports/pmd.xml [PMD] Parsing 1 files in /var/lib/jenkins/workspace/pmd-test [PMD] Successfully parsed file /var/lib/jenkins/workspace/pmd-test/reports/pmd.xml of module with 2269 warnings. [DRY] Collecting duplicate code analysis files... [DRY] Finding all files that match the pattern reports/cpd.xml [DRY] Parsing 1 files in /var/lib/jenkins/workspace/pmd-test [DRY] Parsing of file /var/lib/jenkins/workspace/pmd-test/reports/cpd.xml failed due to an exception: java.io.IOException: No parser found for duplicated code results file /var/lib/jenkins/workspace/pmd-test/reports/cpd.xml at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:93) 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.act(FilePath.java:851) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.dry.DryPublisher.perform(DryPublisher.java:175) at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:144) at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:329) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729) at hudson.model.Run.execute(Run.java:1541) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) (FYI: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl.class is in the CLASSPATH because it is in the SUN rt.jar, but not what we are looking for.) I have only one jar (xercesImpl.jar) in the PATH, which implements org.apache.xerces.jaxp.SAXParserFactoryImpl. I created the folder "c:\Program Files\Java\jre6\lib\endorsed\" and copied that jar into it. Now PMD publishing runs successfully. Copy/Paste detection publishing (DRY) again fails with the following error on the slave console: Oct 23, 2012 3:40:34 PM com.youdevise.hudson.slavestatus.SlaveListener call INFO: Slave-status listener starting Oct 23, 2012 3:40:34 PM com.youdevise.hudson.slavestatus.SocketHTTPListener waitForConnection INFO: Slave-status listener ready on port 3141 Oct 23, 2012 3:40:45 PM org.apache.commons.digester3.Digester getParser SEVERE: Digester.getParser: java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null" at javax.xml.parsers.SAXParserFactory.setXIncludeAware(Unknown Source) at org.apache.commons.digester3.Digester.getFactory(Digester.java:439) at org.apache.commons.digester3.Digester.getParser(Digester.java:652) at org.apache.commons.digester3.Digester.getXMLReader(Digester.java:799) 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:2308) 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(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:60) at java.lang.Thread.run(Unknown Source) And the Jenkins log shows: [DRY] Collecting duplicate code analysis files... ERROR: Publisher hudson.plugins.dry.DryPublisher aborted due to exception java.lang.NullPointerException at org.apache.commons.digester3.Digester.getXMLReader(Digester.java:799) 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:2308) 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(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:60) at java.lang.Thread.run(Unknown Source)

          Ulli Hafner added a comment -

          Ok, thanks for the detailed input. Just to be sure: can you please clean up your JLNP classes cache so that all classes are reloaded from the master.

          Somehow the correct XML parser is not found on your machine in the PMD issue. Maybe another tool defined that SAX parser instance and now my plug-in tries to reuse it (which is not on the class path). I need to investigate how I can reset the XML parser.

          The second problem is different. Can you please attach the cpd.xml file? (Or clone this issue since these two problems seem to be unrelated)

          Ulli Hafner added a comment - Ok, thanks for the detailed input. Just to be sure: can you please clean up your JLNP classes cache so that all classes are reloaded from the master. Somehow the correct XML parser is not found on your machine in the PMD issue. Maybe another tool defined that SAX parser instance and now my plug-in tries to reuse it (which is not on the class path). I need to investigate how I can reset the XML parser. The second problem is different. Can you please attach the cpd.xml file? (Or clone this issue since these two problems seem to be unrelated)

          Bob Ballantyne added a comment - - edited

          I deleted all of my Java cache, removed the "c:\Program Files\Java\jre6\lib\endorsed\xercesImpl.jar" and re-ran the test. The results are the same.
          I have created Issue 15613 (https://issues.jenkins-ci.org/browse/JENKINS-15613) for the CPD issue and will add the relevant info there.

          Thanks

          Bob Ballantyne added a comment - - edited I deleted all of my Java cache, removed the "c:\Program Files\Java\jre6\lib\endorsed\xercesImpl.jar" and re-ran the test. The results are the same. I have created Issue 15613 ( https://issues.jenkins-ci.org/browse/JENKINS-15613 ) for the CPD issue and will add the relevant info there. Thanks

          Ulli Hafner added a comment -

          Can you please check if this error also occurs with Java 7? Or if Java 6 is installed using Jenkins automatic tool installation?

          Ulli Hafner added a comment - Can you please check if this error also occurs with Java 7? Or if Java 6 is installed using Jenkins automatic tool installation?

          uncletall added a comment -

          Hi,
          I think I know what the problem is as I had the same problem. When you run pmd-cpd on a Windows system the encoding in the xml file is set to Cp1252, which is not an official character set. Then when the plugin tries to read the xml file the Digester3 throws an exception.
          I actually build the plugin from source and added a unit test with my own pmd-cpd.xml files, that why I know the exact cause of the exception that is thrown.
          This problem appeared to me after I upgraded the plugin from .34 to .38. At this point I think the Disgester3 was introduced and this parser is strict on the encoding.

          Now the question is who is to blame , the DryPublisher plugin was working before, now it is not. But Pmd-cpd produces an xml file that is not accepted by disgester3....

          Anyway, I thought it would be easier to fix the bug on the pmd side then to change the parser used in the plugin so I fixed the pmd-cpd bug and filed a bug report with them and my change was accepted.

          To make sure you have the same problem check your pmd-cpd output and check the encoding, if it is Cp1252 then that is probably the problem.

          As a workaround before a new release of pmd you can try the solution offered by Andreas: https://sourceforge.net/p/pmd/bugs/1144/#04f6

          uncletall added a comment - Hi, I think I know what the problem is as I had the same problem. When you run pmd-cpd on a Windows system the encoding in the xml file is set to Cp1252, which is not an official character set. Then when the plugin tries to read the xml file the Digester3 throws an exception. I actually build the plugin from source and added a unit test with my own pmd-cpd.xml files, that why I know the exact cause of the exception that is thrown. This problem appeared to me after I upgraded the plugin from .34 to .38. At this point I think the Disgester3 was introduced and this parser is strict on the encoding. Now the question is who is to blame , the DryPublisher plugin was working before, now it is not. But Pmd-cpd produces an xml file that is not accepted by disgester3.... Anyway, I thought it would be easier to fix the bug on the pmd side then to change the parser used in the plugin so I fixed the pmd-cpd bug and filed a bug report with them and my change was accepted. To make sure you have the same problem check your pmd-cpd output and check the encoding, if it is Cp1252 then that is probably the problem. As a workaround before a new release of pmd you can try the solution offered by Andreas: https://sourceforge.net/p/pmd/bugs/1144/#04f6

          uncletall added a comment - - edited

          This is the unit test that failed when the pmd-cpd.xml contains the Cp1252

          CpdParserTest.java
          @Test
          public void assertCanReadWindowsFile() throws InvocationTargetException {
             String fileName = "pmd-cpd.xml";
             assertTrue(VALID_CPD_FILE, acceptsFile(fileName));
          }
          

          This is the xml that causes the problem:

              <?xml version="1.0" encoding="Cp1252"?>
          

          This is the exception that is thrown which you won't see when running a job, there it will normally just tell you that now parser is found.

          Oct 30, 2013 9:38:45 AM org.apache.commons.digester3.Digester fatalError
          SEVERE: Parse Fatal Error at line 1 column 40: Invalid encoding name "Cp1252".
          org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 40; Invalid encoding name "Cp1252".
          	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
          	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
          

          uncletall added a comment - - edited This is the unit test that failed when the pmd-cpd.xml contains the Cp1252 CpdParserTest.java @Test public void assertCanReadWindowsFile() throws InvocationTargetException { String fileName = "pmd-cpd.xml" ; assertTrue(VALID_CPD_FILE, acceptsFile(fileName)); } This is the xml that causes the problem: <?xml version= "1.0" encoding= "Cp1252" ?> This is the exception that is thrown which you won't see when running a job, there it will normally just tell you that now parser is found. Oct 30, 2013 9:38:45 AM org.apache.commons.digester3.Digester fatalError SEVERE: Parse Fatal Error at line 1 column 40: Invalid encoding name "Cp1252" . org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 40; Invalid encoding name "Cp1252" . at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

          Ulli Hafner added a comment -

          This should be fixed in PMD 5.1.0

          Ulli Hafner added a comment - This should be fixed in PMD 5.1.0

            drulli Ulli Hafner
            bballantyne Bob Ballantyne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: