[
https://issues.jboss.org/browse/JBRULES-3011?page=com.atlassian.jira.plug...
]
Geoffrey De Smet updated JBRULES-3011:
--------------------------------------
Assignee: Edson Tirelli (was: Mark Proctor)
Description:
{code}
function int FSAL(){ return 100; }
rule insFirst
salience ( FSAL ) ## Oops, forgot the parens...
when
then
end
{code}
No compile-time error. At runtime we get:
{code}
Exception in thread "main" org.drools.RuntimeDroolsException: Unexpected
exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@354749
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:730)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at express.Main.execute(Main.java:71)
at express.Main.main(Main.java:93)
Caused by: java.lang.ClassCastException: org.mvel2.util.MethodStub cannot be cast to
java.lang.Number
at org.drools.base.mvel.MVELSalienceExpression.getValue(MVELSalienceExpression.java:86)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:215)
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:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:260)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:343)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
... 5 more
{code}
was:
function int FSAL(){ return 100; }
rule insFirst
salience ( FSAL ) ## Oops, forgot the parens...
when
then
end
No compile-time error. At runtime we get:
Exception in thread "main" org.drools.RuntimeDroolsException: Unexpected
exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@354749
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:730)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at express.Main.execute(Main.java:71)
at express.Main.main(Main.java:93)
Caused by: java.lang.ClassCastException: org.mvel2.util.MethodStub cannot be cast to
java.lang.Number
at org.drools.base.mvel.MVELSalienceExpression.getValue(MVELSalienceExpression.java:86)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:215)
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:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:260)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:343)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
... 5 more
Incorrect salience expression => CCE at runtime
-----------------------------------------------
Key: JBRULES-3011
URL:
https://issues.jboss.org/browse/JBRULES-3011
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Edson Tirelli
Fix For: 5.3.0.Beta1
{code}
function int FSAL(){ return 100; }
rule insFirst
salience ( FSAL ) ## Oops, forgot the parens...
when
then
end
{code}
No compile-time error. At runtime we get:
{code}
Exception in thread "main" org.drools.RuntimeDroolsException: Unexpected
exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@354749
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:730)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at express.Main.execute(Main.java:71)
at express.Main.main(Main.java:93)
Caused by: java.lang.ClassCastException: org.mvel2.util.MethodStub cannot be cast to
java.lang.Number
at org.drools.base.mvel.MVELSalienceExpression.getValue(MVELSalienceExpression.java:86)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:215)
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:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:260)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:343)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
... 5 more
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira