hello all
my problem is that my tests work fine in eclipse, but they
don't work in maven.
when i execute my code via
mvn test
drools cant find the antl CharStream class.
this is the error i get:
java.lang.NoClassDefFoundError: org/antlr/runtime/CharStream
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:276)
at com.hikuku.rules.util.TestHelperRules.getPackage(TestHelperRules.java:85)
at com.hikuku.rules.util.TestHelperRules.readRules(TestHelperRules.java:48)
at com.hikuku.rules.util.TestHelperRules.readRules(TestHelperRules.java:67)
at
com.hikuku.rules.TestMemoryInsertRetract.insertRetract(TestMemoryInsertRetract.java:126)
at
com.hikuku.rules.TestMemoryInsertRetract.testInsertRetractAlldifferent(TestMemoryInsertRetract.java:84)
Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.CharStream
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 32 more
i have the antlr3.jar in my dependencies via the drools-compiler pom.xml
and the class org.antlr.runtime.CharStream is definitely in the classpath.
i can use it from my own code without problems.
but the drools package builder does not seem to find it.
this works (even under maven):
final int a = org.antlr.runtime.CharStream.EOF;
but this doesn't find CharStream:
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(r);
this is my dependency on drools as i have it in my pom:
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>core</artifactId>
<version>3.4.2.v_883_R34x</version>
</dependency>
<dependency>
<groupId>janino</groupId>
<artifactId>janino</artifactId>
<version>2.5.10</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>5.0.0.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-api</artifactId>
<version>5.0.0.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>5.0.0.SNAPSHOT</version>
</dependency>
the snapshot i use is the drools-5.0.0.20090203.112022-386
does anyone have an idea what the problem might be?
thanks, tim