Getting error while generating reports in eclipse.
!ENTRY net.sourceforge.pmd.eclipse.plugin 1 0 2013-07-24 14:20:19.069
!MESSAGE 2327 markers applied on 325 files in 27ms.
!ENTRY net.sourceforge.pmd.eclipse.plugin 1 0 2013-07-24 14:20:19.074
!MESSAGE Review code command terminated. 155 rules were executed against 325 files. Actual PMD duration is about 5047ms, that is about 15.529231 ms/file, 32.56129 ms/rule, 0.10018858 ms/filerule
!ENTRY net.sourceforge.pmd.eclipse.plugin 1 0 2013-07-24 14:20:19.080
!MESSAGE Command ReviewCode excecuted in 5309ms
!ENTRY org.eclipse.core.jobs 4 2 2013-07-24 14:21:03.488
!MESSAGE An internal error occurred during: "RenderReport".
!STACK 0
java.lang.NullPointerException
at net.sourceforge.pmd.RuleViolationComparator.compare(RuleViolationComparator.java:40)
at net.sourceforge.pmd.RuleViolationComparator.compare(RuleViolationComparator.java:20)
at java.util.Collections.indexedBinarySearch(Collections.java:319)
at java.util.Collections.binarySearch(Collections.java:307)
at net.sourceforge.pmd.Report.addRuleViolation(Report.java:192)
at net.sourceforge.pmd.eclipse.runtime.cmd.RenderReportsCmd.createReport(RenderReportsCmd.java:234)
at net.sourceforge.pmd.eclipse.runtime.cmd.RenderReportsCmd.execute(RenderReportsCmd.java:158)
at net.sourceforge.pmd.eclipse.runtime.cmd.JobCommandProcessor$1.run(JobCommandProcessor.java:85)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
What is the solution for this error?
The solution is a bugfix :) It will be included in the next pmd-eclipse-plugin release.
If you want to test it already, you can grab the plugin from here:
https://jenkins.adangel.org/job/pmd-eclipse/lastSuccessfulBuild/artifact/pmd-eclipse-plugin/net.sourceforge.pmd.eclipse.p2updatesite/target/repository/*zip*/repository.zip
unzip the file and point eclipse to the repository and install the plugin.
Last edit: Andreas Dangel 2013-08-04
I just installed the plugin 4.0.2v20131021-1124 in Eclipse 4 and I get exactly the same error whenever it runs a project build or code review:
An internal error occurred during: "ReviewCode".
java.lang.NullPointerException
Is there anything that can be wrong with the PMD configurations at Eclipse preferences? Could it be the project?
Shouldn't the error be a bit more explanatory so I could post in another place if it is not related with this closed ticket? :)
Thanks
This issue is resolved. Please close this ticket...
Last edit: Andreas Dangel 2014-03-30
Hi, could you post more information about the NullPointerException? It might be a different bug...
You can also look into the log file of pmd
pmd-eclipse.log. The location of the logfile can be configured via the preferences.Thanks.
Thank you Andreas for your reply.
I found and fixed the problem because running Eclipse from the command line I could get a more insightful error log.
The problem was caused by .pmd and .ruleset files in the project root having wrong rules format. I used a generated rules from SonarQube export and they were something like rulesets/basic.xml and not rulesets/java/basic.html
Even having the Eclipse plugin configured to use the global configurations it was reading that file.
The only bugs here could be the parsing of that file regardless of the global settings and the error message not so much helpful.
Thanks
Last edit: Joao 2014-03-30