Code review in Luna always throws "An internal error occurred during:...
A source code analyzer
Brought to you by:
adangel,
juansotuyo
When reviewing code in Luna, always got an error message box:
An internal error occurred during: "ReviewCode".
org.apache.xerces.dom.DocumentImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object
My guess is the problem starts from ReviewCodeHandler but I can't see where that message is being thrown.
Full stacktrace:
!ENTRY org.eclipse.core.jobs 4 2 2014-07-11 15:27:44.766
!MESSAGE An internal error occurred during: "ReviewCode".
!STACK 0
java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
at net.sourceforge.pmd.lang.xml.ast.XmlParser$LineNumberAwareSaxHandler.startDocument(XmlParser.java:208)
at org.apache.xerces.parsers.AbstractSAXParser.startDocument(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(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 net.sourceforge.pmd.lang.xml.ast.XmlParser.parseDocument(XmlParser.java:81)
at net.sourceforge.pmd.lang.xml.ast.XmlParser.parse(XmlParser.java:311)
at net.sourceforge.pmd.lang.xml.XmlParser.parse(XmlParser.java:35)
at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:95)
at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:142)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:80)
at net.sourceforge.pmd.eclipse.runtime.cmd.BaseVisitor.reviewResource(BaseVisitor.java:290)
at net.sourceforge.pmd.eclipse.runtime.cmd.ResourceVisitor.visit(ResourceVisitor.java:29)
at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.processResource(ReviewCodeCmd.java:384)
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.processProject(ReviewCodeCmd.java:438)
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.processResources(ReviewCodeCmd.java:340)
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.execute(ReviewCodeCmd.java:185)
at net.sourceforge.pmd.eclipse.runtime.cmd.JobCommandProcessor$1.run(JobCommandProcessor.java:85)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Root cause was, that we had two xerces implementations on the classpath. One very old through a transitive dependency.
This bug will be fixed with the next release (v4.0.4).
Just curious, which commit fixes it?
It's this one: https://github.com/pmd/pmd-eclipse-plugin/commit/9370e0c554adedcb37f4febf4fc57e3696d1429d
In theory, you can install the snapshot version of the plugin from here: http://jenkins.adangel.org/job/pmd-eclipse/lastSuccessfulBuild/artifact/net.sourceforge.pmd.eclipse.p2updatesite/target/repository/
I verified that this fixes the issue with Luna 4.4 and JDK8, by installing from the Jenkins update site (thanks Andreas). I now have my PMD menus/preferences/perspective back.