Anton Giertli created DROOLS-1743:
-------------------------------------
Summary: NPE in RuleNEtworkEvaluator after incremental compilation
Key: DROOLS-1743
URL:
https://issues.jboss.org/browse/DROOLS-1743
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.3.0.Final
Reporter: Anton Giertli
Assignee: Mario Fusco
Attachments: drools-path-memory-reproducer.zip
Having the following drl files :
{code:drl}
package org.hightea.a
import org.drools.compiler.Message
import org.drools.compiler.FirstClass
rule "RG_1"
when
$event : Message()
FirstClass(item1 == $event.message1)
then
System.out.println("RG_1");
end
{code}
and
{code:drl}
package org.hightea.b
import org.drools.compiler.Message
import org.drools.compiler.SecondClass
rule "RG_2"
when
$event: Message()
SecondClass(item1 == $event.message1)
then
System.out.println("RG_2");
end
{code}
We create a module containing the two packages in two drl files and insert a `SecondClass`
fact in the WM.
Then we want to incrementally update to a new module containing only the second DRL.
At first fireAllrules after update, we encounter a NPE in RuleNetwork evaluator (a Segment
memory is not defined in the path memory)
{code:java}
java.lang.NullPointerException
at
org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:114)
at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:212)
at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:87)
at
org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34)
at
org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1067)
at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1014)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1006)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1320)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1311)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1295)
at
org.hightea.IncrementalRemoveRuleTest.testNpeInRuleNetworkEvaluator(IncrementalRemoveRuleTest.java:66)
{code}
Note that we don't encounter this issue when the packages names are the same, or if we
exchange the order of drl file name in the first module.
A reproducer is attached with its source code at
[
https://github.com/hightea/drools-reproducer/tree/path-memory-issue|https...]
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)