[jboss-jira] [JBoss JIRA] (DROOLS-145) CCE during fact insertion when two instances of a KieSession are obtained for the same KieModule

Mario Fusco (JIRA) jira-events at lists.jboss.org
Thu May 23 05:07:06 EDT 2013


Mario Fusco created DROOLS-145:
----------------------------------

             Summary: CCE during fact insertion when two instances of a KieSession are obtained for the same KieModule
                 Key: DROOLS-145
                 URL: https://issues.jboss.org/browse/DROOLS-145
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
            Reporter: Mario Fusco
            Assignee: Mario Fusco


Description of problem:

When creating two instances of the same KieSession from KieContainer instances obtained for the same ReleaseId, a CCE occurs during insertion of the facts into the second KieSession instance. 

If you swap the KieSessions used in the test, the problem arises every time in the second KieSession evaluating the rules. The problem shows up also when using KieModule defining two KieSessions for one KieBase.

When constructing the KieModule every time from scratch, the problem does not occur. The problem also does not occur when using the same instance of KieContainer for creating both KieSessions.

The ClassCastException refers to classes generated for facts defined in DRL.


Version-Release number of selected component (if applicable):

BRMS 6.0.0.DR4
Drools 6.0.0-SNAPSHOT


How reproducible:

I will attach a reference to PR with reproducer.

The test scenario is as follows:

1. create a KieModule with ReleaseId id defining one KieBase with one KieSession

2. get a KieContainer from KieServices.newKieContainer(id) and obtain a KieSession from this KieContainer; insert test facts into this session, no problem occurs

3. get another KieContainer from KieServices.newKieContainer(id) and obtain another KieSession from this KieContainer; try to insert test facts into this session, a ClassCastException occurs (see attachment for the full stacktrace):

java.lang.ClassCastException: org.drools.compiler.integrationtests.Parent cannot be cast to org.drools.compiler.integrationtests.Parent
	at ConditionEvaluator1113e873a5ac4b8a98ffd475b0b5df68.evaluate(Unknown Source)
	at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:212)
	at org.drools.core.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:181)
	at org.drools.core.common.DoubleNonIndexSkipBetaConstraints.isAllowedCachedLeft(DoubleNonIndexSkipBetaConstraints.java:134)
	at org.drools.core.reteoo.JoinNode.propagateFromLeft(JoinNode.java:135)

....

Please note that Parent is a class for fact defined in DRL. The exception happens during the insert operation (NamedEntryPoint.insert).


Actual results:

Inserting facts into the second KieSession throws a CCE.


Expected results:

Inserting facts works for both KieSessions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list