Bug 1330327

Summary: [GSS] (6.3.z) java.lang.ClassCastException occurs when building complicated rules containing many eval statements.
Product: [Retired] JBoss BRMS Platform 6 Reporter: Gary Hu <ghu>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: mfusco, mwinkler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1329735
: 1330821 (view as bug list) Environment:
Last Closed: 2020-03-27 19:08:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1329735    
Bug Blocks: 1330821    

Description Gary Hu 2016-04-25 22:18:07 UTC
+++ This bug was initially created as a clone of Bug #1329735 +++

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?

--- Additional comment from JBoss Product and Program Management on 2016-04-22 15:00:19 EDT ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.