10.0.0 NullPointer from RuleExecutor.removeDormantTuple

31 views
Skip to first unread message

otaf otaf

unread,
Jul 9, 2025, 9:50:47 AMJul 9
to Drools Usage
Hello,

we use a bpmn process to call groups by ruleFlowGroup eg agenda-group in drools 10.0, for rules previously used in 7.xx version, but our rules/process execution ends in NPE in 10.0.0

We encounter NullPointer exceptions that look like the ones in the bug reported  in https://groups.google.com/g/drools-usage/c/8uEneCrbaYY, so I tried some workarounds, but the NPE does not occur in a from / accumulate condition.
The other thing is that the startProcess seems to absorb this (Runtime) exception, so from the exception handling point of view, nothing happens.


The only hint I have is that a rule  for which the agenda group  has already been deactivated has a match created. See below for details :

My questions would be :
- does this bug ring a bell to drools developers in v10 ? I saw no issue/PR on this in https://github.com/apache/incubator-kie-drools/issues?q=is%3Aissue%20null
- is there a possible fix already in 10.1 rc1 ?
- how can I debug efficiently this ? I put loggers in AgendaEventListener implementation, but maybe missing something yet in the details of the events to analyse.
- could I use a simplified workflow in my bpmn and fire rules with more control like in https://docs.jboss.org/drools/release/8.44.0.Final/drools-docs/drools/rule-engine/index.html#_agenda_groups_for_rules ?


eg
Agenda agenda = ksession.getAgenda();
agenda.getAgendaGroup( "report" ).setFocus();
agenda.getAgendaGroup( "calculation" ).setFocus();
ksession.fireAllRules();


- More info on our setup / not easy to create a reproducer

Eg order in our workflow simplified (we have 30 groups) is


rule group 1 : 10 rules
rule group 2
rule group 3
rule group 4
rule group 5
rule group 6 : 6 rules

- When Calling a fire All rules :
rule groups 1 to 5 execute in order : we see messages that activate and deactivate the groups with or without match Fired


afterRuleFlowGroupActivated : rule group 1
afterMatchFired (rule of group 1)
afterRuleFlowGroupDeactivated : rule group 1

... activation and deactivation of rule groups 2 to 5

afterRuleFlowGroupActivated rule group 6
afterMatchFired : rule in  rule group 6
matchCreated : rule in rule group 1
-> Null pointer

Caused by: java.lang.NullPointerException: Cannot invoke "org.drools.core.util.DoubleLinkedEntry.setNext(org.drools.core.util.SingleLinkedEntry)" because the return value of "org.drools.core.util.DoubleLinkedEntry.getPrevious()" is null
        at org.drools.core.util.LinkedList.remove(LinkedList.java:178)
        at org.drools.core.phreak.RuleExecutor.removeDormantTuple(RuleExecutor.java:318)
        at org.drools.core.phreak.RuleExecutor.modifyActiveTuple(RuleExecutor.java:338)
        at org.drools.core.phreak.PhreakRuleTerminalNode.doLeftTupleUpdate(PhreakRuleTerminalNode.java:227)



Alex Porcelli

unread,
Jul 12, 2025, 1:21:49 PMJul 12
to drools...@googlegroups.com
We'd need a reproducer, preferably using the latest released version
(10.1.0 - https://kie.apache.org/docs/start/download ).

If the NPE is related to the reported issue you linked, it is likely
that it didn't make the cut. You may need to wait until 10.2.0. But
please share the reproducer so it's possible to better evaluate.
> --
> You received this message because you are subscribed to the Google Groups "Drools Usage" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/drools-usage/ca5cb73b-7995-4f44-b859-ddfbe79c4f6dn%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages