-
Bug
-
Resolution: Done
-
Major
-
6.0.1.Final
-
None
-
None
When trying to migrate to Drools 6.0.1 (everything was fine with 6.0.0) we get multiple ClassCastException.
Assume we have hierarchy where B and C are children of A and we have following rules:
when:
B(....)
then:
...
when:
C(...)
then:
...
Then following exceptions are observed on every execute with instance of B() in context:
java.lang.ClassCastException: B cannot be cast to C
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:217)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:174)
at org.drools.core.phreak.PhreakFromNode.checkConstraintsAndPropagate(PhreakFromNode.java:298)
at org.drools.core.phreak.PhreakFromNode.doLeftInserts(PhreakFromNode.java:101)
at org.drools.core.phreak.PhreakFromNode.doNode(PhreakFromNode.java:49)
at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:348)
at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:200)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:67)
at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:957)
at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:941)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:264)
Again, everything works OK in Drools 6.0.0.