[rules-users] Class loading for facts used in rules

seemamani seemamani at gmail.com
Thu May 21 04:32:12 EDT 2009


I have a rule in which I use objects of a class X. I compiled and packaged
this rule using BRMS for which I uploaded a jar containing class X as the
model. I use a rule agent to build a rulebase from this package. Now, when I
pass the facts of type X to the rule engine, I get a ClassCastException
saying that "X is incompatible with Y". Y is a subclass of X, but the
problem is that a superclass object cannot be assigned to a subclass type.
That means somehow, Y is getting loaded instead of X. 

I'm trying to identify at which point this is happening. In the above case,
when does the class loading happen for the types used in a rule? Is it at
step 1, 2 or 3 ? 
1. When the rule is compiled using MVEL?
2. When the rule is called the first time?
3. When the rulebase is built from the package?

Thanks,
Seema
-- 
View this message in context: http://www.nabble.com/Class-loading-for-facts-used-in-rules-tp23649584p23649584.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list