Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7056

NullPointerException when sending DeleteCommand for non-existing fact

XMLWordPrintable

    • 2022 Week 26-28 (from Jun 27)
    • 2
    • NEW
    • NEW
    • ---
    • ---

      When kie-server client send a DeleteCommand for non-existing fact (e.g. delete twice, or dispose beforehand), NullPointerException is thrown.

      13:17:52,101 ERROR [org.kie.server.services.drools.DroolsKieContainerCommandServiceImpl] (default task-1) Error calling container 'kie-server-kjar-example_1.0.0': java.lang.NullPointerException
      	at deployment.kie-server.war//org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:474)
      	at deployment.kie-server.war//org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:439)
      	at deployment.kie-server.war//org.drools.core.command.runtime.rule.DeleteCommand.execute(DeleteCommand.java:75)
      	at deployment.kie-server.war//org.drools.core.command.runtime.rule.DeleteCommand.execute(DeleteCommand.java:31)
      	at deployment.kie-server.war//org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:169)
      	at deployment.kie-server.war//org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:70)
      	at deployment.kie-server.war//org.drools.core.fluent.impl.PseudoClockRunner.executeBatch(PseudoClockRunner.java:102)
      	at deployment.kie-server.war//org.drools.core.fluent.impl.PseudoClockRunner.executeBatches(PseudoClockRunner.java:69)
      	at deployment.kie-server.war//org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:61)
      	at deployment.kie-server.war//org.drools.core.fluent.impl.PseudoClockRunner.execute(PseudoClockRunner.java:39)
      	at deployment.kie-server.war//org.drools.core.runtime.InternalLocalRunner.execute(InternalLocalRunner.java:48)
      	at deployment.kie-server.war//org.drools.core.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:732)
      	at deployment.kie-server.war//org.kie.server.services.drools.RulesExecutionService.call(RulesExecutionService.java:63)
      	at deployment.kie-server.war//org.kie.server.services.drools.DroolsKieContainerCommandServiceImpl.callContainer(DroolsKieContainerCommandServiceImpl.java:70)
      	at deployment.kie-server.war//org.kie.server.remote.rest.drools.CommandResource.manageContainer(CommandResource.java:98)
      

      https://github.com/kiegroup/drools/blob/7.72.0.Final/drools-core/src/main/java/org/drools/core/common/NamedEntryPoint.java#L470-L474

      If the handle doesn't exist in objectStore, handle becomes null. Hence NPE.

      It's harmless but it should return a better response?

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: