[rules-dev] Error when adding custom evaluator to Guvnor

Willem Jan glival at glival.nl
Mon Feb 7 05:24:09 EST 2011


I'm running a JBoss AS 4.2.3 instance to deploy Drools Guvnor as well as a
service (MyApp) which interacts with it (downloads the compiled packages
from Guvnor, and fires the rules based on requests sent to it). In this
service, I've defined a custom evaluator definition
"InRangeOfEvaluatorDefinition". This evaluator works as expected when firing
rules loaded from the file system. However, when compiling a package in
Guvnor which uses the evaluator, the following exception is thrown:

java.lang.ClassCastException: com.my.app.InRangeOfEvaluatorDefinition cannot
be cast to org.drools.base.evaluators.EvaluatorDefinition

11:15:25,834 ERROR [STDERR] Caused by: java.lang.ClassCastException:
com.my.app.InRangeOfEvaluatorDefinition cannot be cast to
org.drools.base.evaluators.EvaluatorDefinition
11:15:25,835 ERROR [STDERR]     at
org.drools.base.evaluators.EvaluatorRegistry.addEvaluatorDefinition(EvaluatorRegistry.java:128)

I've added the definition to
drools-guvnor.war/META-INF/drools.packagebuilder.conf:
drools.evaluator.inrangeof = com.my.app.InRangeOfEvaluatorDefinition

My first guess would be that MyApp and Guvnor use different versions of
org.drools.base, but both seem to use Drools 5.1.1 (same JAR sizes).

Any ideas would be appreciated. Thanks in advance!
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Error-when-adding-custom-evaluator-to-Guvnor-tp2442223p2442223.html
Sent from the Drools - Dev mailing list archive at Nabble.com.


More information about the rules-dev mailing list