problem in Maven tests: class antlr CharStream not found, although it is there!
by tim tim
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
15 years, 9 months
How to Handle Decision Table (XSL files) in Drools version 4.0.7
by Hong-Qiang Gao
Is there a better way to handle Decision Table (XSL files) with Drools
version 4.0.7?
In Drools 2.1, I can do the following;
file = new File(dir, XSL_filename);
InputStream stream = null;
RuleBase ruleBase = null;
WorkingMemory wm = null;
try {
stream = new FileInputStream(file);
} catch{...
}
try{
ruleBase = DecisionTableLoader.loadFromInputStream(stream);
WorkingMemory wm = ruleBase.newWorkingMemory();
} catch{ ...
}
In Drool 4.0.7, I tried the following
file = new File(dir, XSL_filename);
InputStream stream = null;
RuleBase ruleBase = null;
try {
stream = new FileInputStream(file);
} catch{...
}
try{
ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilder builder = new PackageBuilder();
SpreadsheetCompiler sCompiler = new SpreadsheetCompiler();
String drl = sCompiler.compile(stream, InputType.XLS);
builder.addPackageFromDrl(new StringReader(drl));
ruleBase.addPackage(builder.getPackage());
WorkingMemory wm = ruleBase.newStatefulSession();
} catch{ ...
}
Thanks,
Hong
15 years, 9 months
Combining JSP pages and Drools 5
by Femke De Backere
Hi!
Is there any possibility to combine the use of JSP pages, or another
webtechnology and Drools 5 Ruleflow? I'm really stuck on the human
tasks and I wanted to try it in another way. Or where can I find a
specific example of a ruleflow with human tasks included?
Thx!
Femke
15 years, 9 months
Drools Community Clinic Feb 4th 5PM GMT
by Mark Proctor
I'm going to try an informal experiment for the 4th of February at 5PM
GMT (Date/Time subject to change), we will run an online Drools Clinic
in the form of a Webinar. So the idea here isn't of a 60 minute
presentation, but really more of a 60 minute interactive Q&A where we
will use the desktop to assist in some explanations talking through code
or examples. What do people think?
Ideally we would have a set of pre-determined questions, with some adhoc
ones on the day too. Feel free to start listing your Qs here. I want to
avoid "What's WorkingMemory" type questions, but other than that,
anything is game. Also if anyone has anything cool they would like to
discuss about how they have used Drools, or just general interesting AI
ideas, then that's fine too - happy for this just to turn into a fun
geek chat too.
Mark
15 years, 9 months
Drools 4.0.7, Java 5 which mvel version should I use
by Gras, Patrick
Hello,
I just started to use Enums in my rules and I got following Exception during execution of the rule (compilation of rules is OK)
[...]
Caused by: org.mvel.PropertyAccessException: unable to resolve property: unable to resolve token: MetaType.cover
MetaType is an Enum...
I know my error may not be related with the version of mvel but I noticed I'm using mvel-1.3.1-java1.4.jar which looks like a version for java 1.4, so my question is what version of mvel should I use?
I know I have to use a 1.3.* version, but I've read somewhere 1.3.13 won't initialise, so I guess I should use 1.3.12?
Thanks for your help
-Patrick
15 years, 10 months
Question about drools-server
by Zhang Jing-A52198
Hi All,
I'm trying to build/deploy drools-server from source. I know that the
rule agent configurations are to be placed in the "resources" directory.
Where should the drl file be put (e.g., the properties file contains:
file=test_rules1.drl)?
Thanks,
Jing
15 years, 10 months
upgrade Drools from 2.1 to 4.0.7
by Hong-Qiang Gao
I am new to Drools. Are there any documents that detail the upgrade from
2.1 to 3.0 or to 4.0.7? In the 4.0.7 documents, there are good
descriptions of upgrading from 3.0 to 4.0.7 and also many examples. Is
there any examples that use org.drools.decisiontable.parser.xls?
Thanks,
Hong
15 years, 10 months
Community Clinic
by J Michael Dean
Sorry to be ignorant but what are the details about the planned
February 4th Webinar? How to connect, etc.? Thanks.
- Mike
15 years, 10 months
scheduled starting of a ruleflow-group / drools fusion docs
by Trägenap
Hi,
2 questions:
1. I want to start a ruleflow-group for e.g. only once a day? I am not
interested in the pattern matches during the complete day, just
interested in the result of the single computation. My ruleflow-group is
ordered using a salience, the final/last rule should be processed once a
day, repeating at the next day, and so on...
I found the example like this
StockTick( symbol == "RHAT" ) over window:time( 60 )
(...that happened in the last 60 clock ticks...)
What is declared as "clock ticks"?
2. I guess that drools fusion can solve my problem, is some more
detailed doc available at this moment? (more than the ´pure´ headlines
containing doc I found everywhere?)
Thanks for advice, including just giving keywords!
Thorsten
15 years, 10 months