[antlr-interest] Q: Help! "CharScanner; panic: ClassNotFoundException" using StringTemplate library - how do I fix this?

Austin Hastings Austin_Hastings at Yahoo.com
Mon Nov 26 08:13:33 PST 2007


Howdy,

I'm using antlr3 to generate my parser, and trying to use StringTemplate 
to emit java code. Running my test cases under junit works okay, but 
when I try to build a mostly-self-contained jar file, things start to go 
awry.

Currently, I'm building a jar that includes the antlr3 runtime, the 
entire antlr2-2.7.7.jar, the stringtemplate-3.1b1.jar, some other 
(non-antlr, non-st) exploded jars, and my own .class files & stg files. 
I am specifying a classpath that includes this jar and nothing else.

When I run this, I get

CharScanner; panic: ClassNotFoundException: 
org.antlr.stringtemplate.language.ChunkToken

Google suggests that the solution is classpath related, but I've got 
everything AND the kitchen sink exploded into a single jar, so I'm stuck 
- what is really going on here, and how do I fix it?

Note that I can get the thing to work in a more relaxed environment 
under junit, it's the final transition to production that is the 
stumbling block.

=Austin



More information about the antlr-interest mailing list