Facing intermittently Null pointer exception while setting the variable in delegateExecution.
delegateExecution.setVariableLocal(“FAILURE_REASON”, “failureReason”);
This happens a few times when two different process instance is running parallel.
Didn’t observe this while running only a single process instance.
java.lang.NullPointerException
at org.camunda.bpm.engine.impl.history.producer.DefaultHistoryEventProducer.createHistoricVariableEvent(DefaultHistoryEventProducer.java:429)
at org.camunda.bpm.engine.impl.history.producer.DefaultHistoryEventProducer.createHistoricVariableCreateEvt(DefaultHistoryEventProducer.java:838)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceHistoryListener$1.createHistoryEvent(VariableInstanceHistoryListener.java:42)
at org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor.processHistoryEvents(HistoryEventProcessor.java:77)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceHistoryListener.onCreate(VariableInstanceHistoryListener.java:39)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceHistoryListener.onCreate(VariableInstanceHistoryListener.java:32)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.invokeVariableLifecycleListenersCreate(AbstractVariableScope.java:353)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.invokeVariableLifecycleListenersCreate(AbstractVariableScope.java:347)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocal(AbstractVariableScope.java:342)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocal(AbstractVariableScope.java:381)
Need help here to find the root cause and solution.