Red Hat Bugzilla – Bug 1001990
Drools 6 sample project can't be run
Last modified: 2014-08-06 16:15:20 EDT
Description of problem:
If you create a project with all samples for Drools 6 and try to run the sample classes, you get build errors.
Version-Release number of selected component (if applicable):
JBoss Drools Core 126.96.36.199308222359 org.drools.eclipse.feature.feature.group
Steps to Reproduce:
1. create new Drools 6 project with all samples
2. run DroolsTest class
java.lang.RuntimeException: Error while creating KieBase
Rules run fine and print the correct output.
The problem is that Sample.xls and Sample.drl use the Message class, but both files use their own definition. This was not problem prior to 6 version, but things changed in Drools 6. Now both files are included in one KieBase, where imports are merged, thus thic conflict.
I see two solutions to this problem:
1) create a common class Message that both rulesets will use
2) modify kmodule.xml to include only packages relevant to the type of KieBase (e.g. for 'rules' KieBase, add attribute 'packages="rules"')
Verified with Drools plugin 6.0.1.Final