Bug 986483

Summary: java.lang.Boolean cannot be cast to org.drools.spi.Activation when used incremental kAgent + accumulate
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: CLOSED UPSTREAM QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: BRMS 5.3.1CC: mfusco, nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:28:07 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:    
Bug Blocks: 986451    
Attachments:
Description Flags
Unit test
none
Maven project with Alessandro's reproducer none

Description Alessandro Lazarotti 2013-07-19 21:46:37 UTC
Created attachment 775980 [details]
Unit test

Description of problem:

When used accumulate and incremental changes from the kagent (drools.agent.newInstance as false)the exception below is throwed:

Exception in thread "Thread-0" java.lang.ClassCastException: 
java.lang.Boolean cannot be cast to org.drools.spi.Activation
     at org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter.cleanUp(RuleTerminalNode.java:492)
     at org.drools.reteoo.BetaNode.doRemove(BetaNode.java:381)
     at org.drools.common.BaseNode.remove(BaseNode.java:105)
     at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:367)
     at org.drools.common.BaseNode.remove(BaseNode.java:105)

Steps to Reproduce:
1. Running the unit test attached.

Actual results:
java.lang.ClassCastException

Expected results:
Rules firing as expected without exceptions

Comment 1 JBoss JIRA Server 2013-07-19 22:22:15 UTC
Davide Sottara <dsotty> made a comment on jira DROOLS-197

no CCE with 5.6

Comment 2 Edson Tirelli 2013-07-23 14:11:42 UTC
Lukas, Alessandro, what is the context for this ticket? Is it for 5.3.x or 6.x? If it is for 5, was it reported by a customer and we need to backport the fixes?

Just trying to understand what needs to be done here.

Comment 3 Edson Tirelli 2013-07-23 14:19:19 UTC
Just got the e-mail from Alessandro:

=============
They should be part of the Roll Up Patch BRMS_5.3.1_3_2013 - 
https://bugzilla.redhat.com/show_bug.cgi?id=986451
BZs to it should be added and committed until 09/Aug (3 weeks) - after 
that is started the productisation work. So an ETA to get it fixed is 
until 09-Aug.
=============

Comment 4 Mario Fusco 2013-08-08 08:53:33 UTC
I ran the provided unit test on the 5.3.x branch twice doing 1000+ cycles for each run but I couldn't reproduce this issue, so I am assuming the fix has been already backported.

Comment 5 Marek Winkler 2013-09-13 08:30:44 UTC
I have reproduced the same exception with BRMS.5.3.1-P4 using the unit test by Alessandro. I ran it as a stand-alone test (I did not run it as a part of Drools or BRMS test suite, I had difficulties to reproduce it when running it in the test suite, although I do not understand how this could affect the reproducability).

I have created a simple Maven project containing the reproducer by Alessandro.

You should be able to reproduce the problem by running 'mvn clean test' in the unzipped project.

Comment 6 Marek Winkler 2013-09-13 08:32:02 UTC
Created attachment 797206 [details]
Maven project with Alessandro's reproducer

Comment 7 JBoss JIRA Server 2013-09-16 09:33:26 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-197 to Resolved

Comment 8 Mario Fusco 2013-09-16 09:34:57 UTC
I tried Marek's test project against both the patch and 5.3.x snapshot, but I couldn't reproduce this problem.

Comment 9 Mario Fusco 2013-09-16 11:06:29 UTC
Sorry, I can actually reproduce this problem. I just didn't realize that the provide test case doesn't fail but just logs the exception stack trace. Investigating ...

Comment 10 Mario Fusco 2013-09-16 12:13:06 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/f6b68f5cb#L1L492

Comment 11 Marek Winkler 2013-09-20 08:52:37 UTC
Verified on 5.3.1.BRMS-P04.

Comment 13 Red Hat Bugzilla 2025-02-10 03:28:07 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.