0

I am using checkstyle 5.5 for my project and building using Jenkins 1.462.

My project builds successfully, but every java class in my project causes Checkstyle to create a high priority, TreeWalker error like below:

ProductComparisonService.java:0, TreeWalker, Priority: High Got an exception - java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token

No description available. Please upgrade to latest checkstyle version.

I tried upgrading to checkstyle 5.6 but that did not solve the problem. I'd appreciate any ideas.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Aaron
  • 23,450
  • 10
  • 49
  • 48

1 Answers1

2

You have a conflicting version of antlr(works) in some other plugin that you're using, and that is interfering in the classloader. You need to unload that other plugin.

I haven't myself tested, but here are some recommended tools that might be able to find the offending jar for you:

Community
  • 1
  • 1
eis
  • 51,991
  • 13
  • 150
  • 199
  • I've got about 90 other jars in the project. Is there an easy way that you know of to determine what is the offending jar? – Aaron Jan 11 '13 at 19:22
  • @KamikazeMercenary added some tools for you. Haven't tried myself though, so don't know if it is easy or not. – eis Jan 12 '13 at 10:04