[
https://issues.jboss.org/browse/JBRULES-3327?page=com.atlassian.jira.plug...
]
Edson Tirelli reassigned JBRULES-3327:
--------------------------------------
Assignee: Edson Tirelli (was: Mark Proctor)
Weird exception thrown: java.lang.ClassCastException:
org.drools.reteoo.InitialFactImpl cannot be cast to XXX...
-----------------------------------------------------------------------------------------------------------------
Key: JBRULES-3327
URL:
https://issues.jboss.org/browse/JBRULES-3327
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.3.0.Final
Environment: jdk 1.6u27, ubuntu linux 11.04
Reporter: Miles Wen
Assignee: Edson Tirelli
Labels: ClassCastException, InitialFactImpl
This code throws exception at runtime, with default settings:
rule "out"
when
l1:Msg(str == 'test') and
l2:Msg(!bool) or
eval(!false)
then
end
which throws:
org.drools.RuntimeDroolsException: Unexpected exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@ef894ce
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:315)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at com.sample.DroolsTest.main(DroolsTest.java:51)
Caused by: org.drools.RuntimeDroolsException: com.sample.Rule_outEval0Invoker@3e1b05a2 :
java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to
com.sample.Msg
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:119)
at org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:178)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:146)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:158)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:284)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:404)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:975)
... 6 more
Caused by: java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast
to com.sample.Msg
at com.sample.Rule_outEval0Invoker.evaluate(Unknown Source)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:114)
... 17 more
P.S: 'Msg' is an arbitrary pojo fact defined by user.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira