[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2735) ClassCastException for casting DefaultFactHandle to EventFactHandle when using Sliding Windows
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Thu May 19 16:37:01 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-2735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603263#comment-12603263 ]
Edson Tirelli commented on JBRULES-2735:
----------------------------------------
I checked the problem and it is actually more complicated then it seems. "From" handles the expression as a black box, and creates a new fact handle for each result returned from the expression. When it does that, it loses all the reference data assigned to an event when it is first inserted into the engine, i.e., it gives the events new values for the new fact handle. This is of course undesirable, but a simple try to re-use the existing fact handle creates problems in lots of other places, as it was not designed for that.
This also related to the problem reported by Davide in JBRULES-2423.
Obviously, there are alternatives to improve the situation but then we face even worst performance problems than the one reported in JBRULES-2685.
So, we will need to thing these 3 problems as one and come up with a solution. Unfortunately, it will not make Drools 5.2, so I am rescheduling the ticket to 5.3M1.
> ClassCastException for casting DefaultFactHandle to EventFactHandle when using Sliding Windows
> ----------------------------------------------------------------------------------------------
>
> Key: JBRULES-2735
> URL: https://issues.jboss.org/browse/JBRULES-2735
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core (fusion)
> Affects Versions: 5.1.1.FINAL
> Environment: Windows XP SP3, Java 1.6.0_21, Drools 5.1.1
> Reporter: Will Lauer
> Assignee: Edson Tirelli
> Fix For: 5.3.0.M1
>
>
> When playing with a simple sliding window test using a single type of fact with @role(event), the following ClassCastException is generated:
> Exception in thread "main" java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
> at org.drools.base.evaluators.BeforeEvaluatorDefinition$BeforeEvaluator.evaluateCachedLeft(BeforeEvaluatorDefinition.java:333)
> at org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestriction.java:110)
> at org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstraint.java:115)
> at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:142)
> at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:274)
> at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
> at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
> at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
> at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:662)
> at org.drools.reteoo.AccumulateNode.assertLeftTuple(AccumulateNode.java:181)
> at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
> at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138)
> at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:148)
> at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
> at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:368)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
> at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1174)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
> at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
> at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
> at net.wlauer.DroolsEngine.NonSpringRulesEngine.main(NonSpringRulesEngine.java:71)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list