Bug 1329735 - java.lang.ClassCastException occurs when building complicated rules containing many eval statements.
Summary: java.lang.ClassCastException occurs when building complicated rules containin...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Mario Fusco
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks: 1330327 1330821
TreeView+ depends on / blocked
 
Reported: 2016-04-22 19:00 UTC by Gary Hu
Modified: 2020-03-27 19:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1330327 (view as bug list)
Environment:
Last Closed: 2020-03-27 19:12:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-1139 0 Major Resolved Incomplete cloning of the EvalCondition evaluator 2016-05-24 15:21:11 UTC

Description Gary Hu 2016-04-22 19:00:01 UTC
The following exception is thrown when building complicated rules containing many eval statements:

java.lang.ClassCastException: xxxxx cannot be cast to xxxx
   at org.drools.core.rule.EvalCondition.isAllowed(EvalCondition.java:123)
   at org.drools.core.phreak.PhreakEvalNode.doLeftInserts(PhreakEvalNode.java:70)
   ...

The root cause could be found from https://issues.jboss.org/browse/DROOLS-1139

"An EvalCondition evaluator needs to be cloned when 2 eval nodes have the same condition, but not the same parent and then cannot be shared. This cloning process is currently incomplete because the eval invoker (generated via ASM) remains the same (same instance) for the 2 evaluators thus resulting in an evaluation with wrong params."

A fix has been submitted in the pull request - https://github.com/droolsjbpm/drools/pull/758

Can we apply this fix to our brms production?

Comment 2 Mario Fusco 2016-04-26 14:33:38 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/8eadcaaff


Note You need to log in before you can comment on or make changes to this bug.