When in stream mode a rule is removed by an incremental compilation, the right tuples in the stream queues of the memories of the correspondingly removed beta nodes don't get unlinked. This causes the following NPE when you try to programmatically remove from the session the fact to which one of those right tuple was referring to: java.lang.NullPointerException at org.drools.core.reteoo.NotNode.doDeleteRightTuple(NotNode.java:184) at org.drools.core.reteoo.NotNode.retractRightTuple(NotNode.java:172) at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:347) at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:339) at org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:392) at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:556) at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:519) at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1530) at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1521)
Fixed by https://github.com/droolsjbpm/drools/commit/730120030
Cherry-picked to 6.2.x branch with https://github.com/droolsjbpm/drools/commit/64b0db977
Verified in BRMS 6.1.0 CR1.
Mario Fusco <mario.fusco> updated the status of jira DROOLS-731 to Resolved