Bug 986483 - java.lang.Boolean cannot be cast to org.drools.spi.Activation when used incremental kAgent + accumulate
java.lang.Boolean cannot be cast to org.drools.spi.Activation when used incre...
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion) (Show other bugs)
BRMS 5.3.1
Unspecified Unspecified
urgent Severity urgent
: GA
: ---
Assigned To: Mario Fusco
Marek Winkler
Depends On:
Blocks: 986451
  Show dependency treegraph
Reported: 2013-07-19 17:46 EDT by Alessandro Lazarotti
Modified: 2013-09-20 04:52 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Unit test (6.42 KB, text/x-java)
2013-07-19 17:46 EDT, Alessandro Lazarotti
no flags Details
Maven project with Alessandro's reproducer (5.32 KB, application/zip)
2013-09-13 04:32 EDT, Marek Winkler
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-197 Major Resolved java.lang.Boolean cannot be cast to org.drools.spi.Activation when used incremental kAgent + accumulate 2014-05-02 05:31:48 EDT

  None (edit)
Description Alessandro Lazarotti 2013-07-19 17:46:37 EDT
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:

Expected results:
Rules firing as expected without exceptions
Comment 1 JBoss JIRA Server 2013-07-19 18:22:15 EDT
Davide Sottara <dsotty@gmail.com> made a comment on jira DROOLS-197

no CCE with 5.6
Comment 2 Edson Tirelli 2013-07-23 10:11:42 EDT
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 10:19:19 EDT
Just got the e-mail from Alessandro:

They should be part of the Roll Up Patch BRMS_5.3.1_3_2013 - 
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 04:53:33 EDT
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 04:30:44 EDT
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 04:32:02 EDT
Created attachment 797206 [details]
Maven project with Alessandro's reproducer
Comment 7 JBoss JIRA Server 2013-09-16 05:33:26 EDT
Mario Fusco <mario.fusco@gmail.com> updated the status of jira DROOLS-197 to Resolved
Comment 8 Mario Fusco 2013-09-16 05:34:57 EDT
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 07:06:29 EDT
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 08:13:06 EDT
Fixed by https://github.com/droolsjbpm/drools/commit/f6b68f5cb#L1L492
Comment 11 Marek Winkler 2013-09-20 04:52:37 EDT
Verified on 5.3.1.BRMS-P04.

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