[rules-users] NullPointerException with LeftTupleIndexHashTable.remove()

nxv nxvanderlinden at gmail.com
Mon Feb 17 03:11:58 EST 2014


Here is another zip (I removed the test in relation with another issue:
DROOLS-421).  The right method method to execute is
testLeftTupleIndexHashTable() 
Drools-LeftTupleIndexHashTable-61b.zip
<http://drools.46999.n3.nabble.com/file/n4028138/Drools-LeftTupleIndexHashTable-61b.zip>   

Here is the trace:

2014-02-17 09:04:15,450 [main] INFO  Found kmodule:
file:/E:/Project/Haulogy/EnergyComm/IDE/workspace-kepler/drools-61-bug/target/classes/META-INF/kmodule.xml
2014-02-17 09:04:15,454 [main] DEBUG KieModule URL type=file
url=/Project/Haulogy/EnergyComm/IDE/workspace-kepler/drools-61-bug/target/classes
2014-02-17 09:04:15,521 [main] DEBUG Found and used pom.properties
\Project\Haulogy\EnergyComm\IDE\workspace-kepler\drools-61-bug\target\classes\META-INF\maven\org.test2\test\pom.properties
2014-02-17 09:04:15,524 [main] DEBUG Discovered classpath module
org.test2:test:0.0.1-SNAPSHOT
2014-02-17 09:04:15,527 [main] INFO  KieModule was added:FileKieModule[
ReleaseId=org.test2:test:0.0.1-SNAPSHOTfile=\Project\Haulogy\EnergyComm\IDE\workspace-kepler\drools-61-bug\target\classes]
2014-02-17 09:04:16,618 [main] DEBUG Starting Engine in PHREAK mode
2014-02-17 09:04:16,664 [main] TRACE Adding Rule Qualification##Supply
ToStart##Fact loader##DeliveryPeriod from DeliveryPoint
2014-02-17 09:04:16,667 [main] TRACE Adding Rule Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,726 [main] TRACE Insert [fact
0:1:1391516304:1391516304:1:DEFAULT:NON_TRAIT:org.after.evaluate.Message at 52f0da90]
2014-02-17 09:04:16,733 [main] TRACE LinkNode notify=false nmask=1 smask=1
spos=0 rules=
2014-02-17 09:04:16,734 [main] TRACE   LinkSegment smask=2 rmask=2
name=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,738 [main] TRACE LinkNode notify=true nmask=1 smask=1
spos=0 rules=[RuleMem Qualification##Supply ToStart##Fact
loader##DeliveryPeriod from DeliveryPoint], [RuleMem Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo]
2014-02-17 09:04:16,738 [main] TRACE Insert [fact
0:2:528227185:528227185:2:DEFAULT:NON_TRAIT:org.leftTupleIndexHashTable.CommonPayloadData at 1f7c1b71]
2014-02-17 09:04:16,739 [main] TRACE BetaNode insert=1
stagedInsertWasEmpty=true
2014-02-17 09:04:16,739 [main] TRACE LinkNode notify=true nmask=2 smask=3
spos=0 rules=[RuleMem Qualification##Supply ToStart##Fact
loader##DeliveryPeriod from DeliveryPoint], [RuleMem Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo]
2014-02-17 09:04:16,739 [main] TRACE   LinkSegment smask=1 rmask=1
name=Qualification##Supply ToStart##Fact loader##DeliveryPeriod from
DeliveryPoint
2014-02-17 09:04:16,739 [main] TRACE   LinkSegment smask=1 rmask=3
name=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,739 [main] TRACE     LinkRule name=Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,750 [main] TRACE Queue RuleAgendaItem [Activation
rule=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo, act#=0,
salience=0, tuple=null]
2014-02-17 09:04:16,750 [main] TRACE Queue Added 1 [Activation
rule=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo, act#=0,
salience=0, tuple=null]
2014-02-17 09:04:16,750 [main] TRACE Rule[name=Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo] segments=2 TupleSets[insertSize=1,
deleteSize=0, updateSize=0]
2014-02-17 09:04:16,750 [main] TRACE      1 [JoinNode(5) - [ClassObjectType
class=org.leftTupleIndexHashTable.CommonPayloadData]]
TupleSets[insertSize=1, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,750 [main] TRACE      Segment 0
2014-02-17 09:04:16,750 [main] TRACE      1 [JoinNode(5) - [ClassObjectType
class=org.leftTupleIndexHashTable.CommonPayloadData]]
TupleSets[insertSize=1, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,754 [main] TRACE      rightTuples
TupleSets[insertSize=1, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,755 [main] TRACE      Segment 1
2014-02-17 09:04:16,755 [main] TRACE        2 [NotNode(9) - [ClassObjectType
class=org.after.evaluate.DeliveryPoint]] TupleSets[insertSize=1,
deleteSize=0, updateSize=0]
2014-02-17 09:04:16,755 [main] TRACE        Segment 1
2014-02-17 09:04:16,755 [main] TRACE        2 [NotNode(9) - [ClassObjectType
class=org.after.evaluate.DeliveryPoint]] TupleSets[insertSize=1,
deleteSize=0, updateSize=0]
2014-02-17 09:04:16,755 [main] TRACE        rightTuples
TupleSets[insertSize=0, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,756 [main] TRACE          3 [RuleTerminalNode(10):
rule=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo]
TupleSets[insertSize=1, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,756 [main] TRACE          Segment 1
2014-02-17 09:04:16,756 [main] TRACE          3 [RuleTerminalNode(10):
rule=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo]
TupleSets[insertSize=1, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,757 [main] TRACE Fire "Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo" 
[[ Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo active=false ] [
null
[fact
0:2:528227185:528227185:2:DEFAULT:NON_TRAIT:org.leftTupleIndexHashTable.CommonPayloadData at 1f7c1b71]
[fact
0:1:1391516304:1391516304:1:DEFAULT:NON_TRAIT:org.after.evaluate.Message at 52f0da90]
] ]
2014-02-17 09:04:16,760 [main] TRACE Update [fact
0:2:528227185:528227185:3:DEFAULT:NON_TRAIT:org.leftTupleIndexHashTable.CommonPayloadData at 1f7c1b71]
2014-02-17 09:04:16,761 [main] TRACE   LinkSegment smask=1 rmask=1
name=Qualification##Supply ToStart##Fact loader##DeliveryPeriod from
DeliveryPoint
2014-02-17 09:04:16,761 [main] TRACE   LinkSegment smask=1 rmask=3
name=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,761 [main] TRACE     LinkRule name=Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,761 [main] TRACE Insert [fact
0:3:2030712447:2030712447:4:DEFAULT:NON_TRAIT:org.after.evaluate.DeliveryPoint at 790a367f]
2014-02-17 09:04:16,761 [main] TRACE BetaNode insert=1
stagedInsertWasEmpty=true
2014-02-17 09:04:16,761 [main] TRACE LinkNode notify=true nmask=1 smask=1
spos=1 rules=[RuleMem Qualification##Supply ToStart##Fact
loader##DeliveryPeriod from DeliveryPoint]
2014-02-17 09:04:16,761 [main] TRACE   LinkSegment smask=2 rmask=3
name=Qualification##Supply ToStart##Fact loader##DeliveryPeriod from
DeliveryPoint
2014-02-17 09:04:16,761 [main] TRACE     LinkRule name=Qualification##Supply
ToStart##Fact loader##DeliveryPeriod from DeliveryPoint
2014-02-17 09:04:16,761 [main] TRACE Queue RuleAgendaItem [Activation
rule=Qualification##Supply ToStart##Fact loader##DeliveryPeriod from
DeliveryPoint, act#=2, salience=0, tuple=null]
2014-02-17 09:04:16,761 [main] TRACE Queue Added 1 [Activation
rule=Qualification##Supply ToStart##Fact loader##DeliveryPeriod from
DeliveryPoint, act#=2, salience=0, tuple=null]
2014-02-17 09:04:16,762 [main] TRACE LinkNode notify=true nmask=1 smask=1
spos=1 rules=[RuleMem Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo]
2014-02-17 09:04:16,762 [main] TRACE   LinkSegment smask=2 rmask=3
name=Qualification##Supply ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,762 [main] TRACE     LinkRule name=Qualification##Supply
ToStart##Sply-ToStrt_q-Std_crDPo
2014-02-17 09:04:16,762 [main] TRACE Rule[name=Qualification##Supply
ToStart##Fact loader##DeliveryPeriod from DeliveryPoint] segments=2
TupleSets[insertSize=0, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,762 [main] TRACE      4 [JoinNode(5) - [ClassObjectType
class=org.leftTupleIndexHashTable.CommonPayloadData]]
TupleSets[insertSize=0, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,762 [main] TRACE      Segment 0
2014-02-17 09:04:16,762 [main] TRACE      4 [JoinNode(5) - [ClassObjectType
class=org.leftTupleIndexHashTable.CommonPayloadData]]
TupleSets[insertSize=0, deleteSize=0, updateSize=0]
2014-02-17 09:04:16,762 [main] TRACE      rightTuples
TupleSets[insertSize=0, deleteSize=0, updateSize=1]
2014-02-17 09:04:16,762 [main] TRACE      Segment 1
2014-02-17 09:04:16,762 [main] TRACE        5 [JoinNode(7) -
[ClassObjectType class=org.after.evaluate.DeliveryPoint]]
TupleSets[insertSize=0, deleteSize=0, updateSize=1]
2014-02-17 09:04:16,762 [main] TRACE        Segment 1
2014-02-17 09:04:16,762 [main] TRACE        5 [JoinNode(7) -
[ClassObjectType class=org.after.evaluate.DeliveryPoint]]
TupleSets[insertSize=0, deleteSize=0, updateSize=1]
2014-02-17 09:04:16,762 [main] TRACE        rightTuples
TupleSets[insertSize=1, deleteSize=0, updateSize=0]



Mark Proctor wrote
> Also as a tip, turn on TRACE mode, for the logback.xml, and post back the
> results.
> 
> Mark
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
>   
> <appender name="consoleAppender"
> class="ch.qos.logback.core.ConsoleAppender">
>     
> <encoder>
>       
> <pattern>
> %d [%t] %-5p %m%n
> </pattern>
>     
> </encoder>
>   
> </appender>
>   
> <logger name="org.drools" level=“TRACE"/>
>   
> <root level="info">
>     
> <appender-ref ref="consoleAppender" />
>   
> </root>
> 
> </configuration>
> 
> 
> 
> On 16 Feb 2014, at 23:55, Mark Proctor &lt;

> mproctor@

> &gt; wrote:
> 
>> you have two drl files. One with two rules, one with one rule. Which is
>> the rule you were adding and removing to see the bug?
>> 
>> Mark
>> On 16 Feb 2014, at 22:50, nxv &lt;

> nxvanderlinden@

> &gt; wrote:
>> 
>>> Here is the unit test. Drools-LeftTupleIndexHashTable-61.zip
>>> &lt;http://drools.46999.n3.nabble.com/file/n4028135/Drools-LeftTupleIndexHashTable-61.zip&gt;  
>>> 
>>> 
>>> Mark Proctor wrote
>>>> Can you paste the 3 rules, that cause the issue? We’ll see if we can
>>>> gleam
>>>> something from that, while we wait for your unit test.
>>>> 
>>>> Mark
>>>> On 16 Feb 2014, at 19:25, nxv &lt;
>>> 
>>>> nxvanderlinden@
>>> 
>>>> &gt; wrote:
>>>> 
>>>>> Hello,
>>>>> 
>>>>> I keep trying to migrate drools from 5.5 to 6 on my project.  I found
>>>>> a
>>>>> second regression/issue.  I'm trying to produce a unit test for
>>>>> 6.1.0-SNAPSHOT but I face some difficulties to determine the cause of
>>>>> this
>>>>> issue.  So I have a drl with 3 rules.  I'm a bit disappointed because
>>>>> if
>>>>> I
>>>>> switch two rules (without modifying anything, just switch one rule
>>>>> with
>>>>> another in the drl file), the NPE disappears... 
>>>>> 
>>>>> 
>>>>> Here is the stacktrace:
>>>>> 
>>>>> java.lang.NullPointerException
>>>>> 	at
>>>>> org.drools.core.util.index.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:386)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderLeftMemory(RuleNetworkEvaluator.java:799)
>>>>> 	at
>>>>> org.drools.core.phreak.PhreakJoinNode.doNode(PhreakJoinNode.java:38)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:547)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:533)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:201)
>>>>> 	at
>>>>> org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:68)
>>>>> 	at
>>>>> org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
>>>>> 	at
>>>>> org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
>>>>> 	at
>>>>> org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:952)
>>>>> 	at
>>>>> org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:926)
>>>>> 	at
>>>>> org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:232)
>>>>> 	at
>>>>> org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:106)
>>>>> 	at
>>>>> org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:32)
>>>>> 	at
>>>>> org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155)
>>>>> 	at
>>>>> org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76)
>>>>> 	at
>>>>> org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:334)
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> View this message in context:
>>>>> http://drools.46999.n3.nabble.com/NullPointerException-with-LeftTupleIndexHashTable-remove-tp4028133.html
>>>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> rules-users mailing list
>>>>> 
>>> 
>>>> rules-users at .jboss
>>> 
>>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>> 
>>>> 
>>>> _______________________________________________
>>>> rules-users mailing list
>>> 
>>>> rules-users at .jboss
>>> 
>>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://drools.46999.n3.nabble.com/NullPointerException-with-LeftTupleIndexHashTable-remove-tp4028133p4028135.html
>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>> 
>>> _______________________________________________
>>> rules-users mailing list
>>> 

> rules-users at .jboss

>>> https://lists.jboss.org/mailman/listinfo/rules-users
>> 
> 
> 
> _______________________________________________
> rules-users mailing list

> rules-users at .jboss

> https://lists.jboss.org/mailman/listinfo/rules-users





--
View this message in context: http://drools.46999.n3.nabble.com/NullPointerException-with-LeftTupleIndexHashTable-remove-tp4028133p4028138.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list