Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: cannot initialize module TreeWalker - Unable to instantiate JUnitTestCase

After importing a maven project to Eclipse Luna the following error is displayed in a pop-up when saving after modifying a method:

cannot initialize module TreeWalker - Unable to instantiate JUnitTestCase

JUnitTestCase is referring to a module in the checkstyle xml file:

<module name="JUnitTestCase"/>

I have the 'Checkstyle configuration plugin for M2Eclipse' and 'Checkstyle Plug-in 6.4.0' installed. The plugin definition for 'maven-checkstyle-plugin' in my pom file specifies version 2.10.

Note: I realise this is similar to some other questions with the same error (but a different module specified) however I am yet to find a satisfying solution. I believe that I could remove the module entry in the checkstyle config file but I require it to work as designed so that is not the preferable option.

like image 621
Continuity8 Avatar asked Mar 19 '15 02:03

Continuity8


1 Answers

JUnitTestCase was removed in Checkstyle 6.2 (look under "Breaking backward compatibility"). So you should either downgrade to Checkstyle 6.1.1, or remove the module reference from your checkstyle.xml.

like image 89
barfuin Avatar answered Oct 11 '22 23:10

barfuin