Menu

#1492 [core] PMD CLI: IncompatibleClassChangeError when running PMD

PMD-5.5.0
closed
core (10) cli (2)
PMD
3-Major
Bug
5.5.0-SNAPSHOT
2016-06-25
2016-06-04
No

When executing PMD on the command line, multiple errors are logged, e.g.

Could not find class net.sourceforge.pmd.util.viewer.model.ViewerModel, due to: java.lang.IncompatibleClassChangeError: net/sourceforge/pmd/lang/java/typeresolution/visitors/PMDASMVisitor
Jun 04, 2016 7:41:03 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver visit
WARNUNG: Could not find class net.sourceforge.pmd.util.viewer.model.ViewerModel, due to: java.lang.IncompatibleClassChangeError: net/sourceforge/pmd/lang/java/typeresolution/visitors/PMDASMVisitor
Could not find class net.sourceforge.pmd.util.viewer.model.ViewerModelEvent, due to: java.lang.IncompatibleClassChangeError: net/sourceforge/pmd/lang/java/typeresolution/visitors/PMDASMVisitor
Jun 04, 2016 7:41:03 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver visit
WARNUNG: Could not find class net.sourceforge.pmd.util.viewer.model.ViewerModelEvent, due to: java.lang.IncompatibleClassChangeError: net/sourceforge/pmd/lang/java/typeresolution/visitors/PMDASMVisitor
Could not find class net.sourceforge.pmd.util.viewer.model.ViewerModelListener, due to: java.lang.IncompatibleClassChangeError: net/sourceforge/pmd/lang/java/typeresolution/visitors/PMDASMVisitor
Jun 04, 2016 7:41:03 PM net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver visit

This is because of classpath madness - pmd-apex brings apex-jorje-ide jar, which is an uberjar, which conatins ASM in an old version, but PMD itself relies on version 5 (in oder to support java8 etc...). In the older version, org.objectweb.asm.ClassVisitor is a interface, but in the recent version 5.0.4 it is an abstract class - so this change is incompatible :)

Discussion

  • Andreas Dangel

    Andreas Dangel - 2016-06-08
    • status: open --> closed
     
  • Andreas Dangel

    Andreas Dangel - 2016-06-25
    • labels: --> core, cli
    • summary: [CLI] IncompatibleClassChangeError when running PMD --> [core] PMD CLI: IncompatibleClassChangeError when running PMD
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.