[
https://jira.jboss.org/browse/JBRULES-2326?page=com.atlassian.jira.plugin...
]
Edson Tirelli updated JBRULES-2326:
-----------------------------------
Fix Version/s: 5.1.0.CR1
(was: 5.1.0.M2)
request to improve upon error message received from invalid rule
syntax (currently getting NPE)
-----------------------------------------------------------------------------------------------
Key: JBRULES-2326
URL:
https://jira.jboss.org/browse/JBRULES-2326
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 5.1.0.M1
Reporter: Jeremy Ary
Assignee: Edson Tirelli
Fix For: 5.1.0.CR1
My (albeit improper) rule syntax that caused the NPE error:
when
QueueList ( queueIds contains 1 )
( not EventList ( events contains 1 )
|| ( $eventList : EventList ( events contains 1 )
&& RfEvent ( eventTypeId == 1, lastActivationLong after[-1h] sessionTime ) from
$eventList.events ) )
then
modify (eventList) { add(1) }
Stack Trace:
org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
at com.famc.service.RuleFlowRunner.main(RuleFlowRunner.java:118)
Caused by: java.lang.NullPointerException
at org.drools.base.mvel.DroolsMVELFactory.getTupleObjectFor(DroolsMVELFactory.java:182)
at org.drools.base.mvel.DroolsMVELFactory.setContext(DroolsMVELFactory.java:176)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:57)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 6 more
Request for ticket:
[10:19] <etirelli> jary: raising a NPE is clearly a bug, but the reason is that you
have modify(eventList) instead of modify($eventList)... in any case, the way you authored
the rule is not ideal
[10:19] <etirelli> jary: could you please open a JIRA so that we can provide an
appropriate error message, please?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira