cancel
Showing results for 
Search instead for 
Did you mean: 

Getting NullPointer exception when timer job fires

ganeshr
Champ in-the-making
Champ in-the-making
Hi,

I have seen the following exception in log file,

[2013-07-17 05:01:43,557][ERROR][pool-1-thread-41][impl.jobexecutor.TimerCatchIntermediateEventJobHandler][exception during timer execution]
java.lang.NullPointerException
    at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.hasCompensationHandler(AbstractBpmnActivityBehavior.java:54)
    at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:43)
    at org.activiti.engine.impl.bpmn.behavior.ServiceTaskExpressionActivityBehavior.execute(ServiceTaskExpressionActivityBehavior.java:49)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
    at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:66)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
    at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
    at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:365)
    at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:105)
    at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:54)
    at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
    at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:47)
    at org.activiti.engine.impl.bpmn.behavior.IntermediateCatchEventActivityBehavior.signal(IntermediateCatchEventActivityBehavior.java:27)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:348)
    at org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler.execute(TimerCatchIntermediateEventJobHandler.java:45)
    at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:80)
    at org.activiti.engine.impl.persistence.entity.TimerEntity.execute(TimerEntity.java:62)
    at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:70)
    at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)
    at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
    at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
    at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

  And when observed in act_ru_job table, the column exception_stack_id_ has some value and no message in exception_msg_ column. I'm unable to find why this exception is occured. could anyone help me in finding the reason for this exception.

6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
Can you add your BPMN XML in a code-block?

ganeshr
Champ in-the-making
Champ in-the-making
Hi,

   I have attached the BPMN xml code.

frederikherema1
Star Contributor
Star Contributor
Seems like an issue with the execution the activity is waiting in. Probabily the inclusive gateway causing one of the executions the timers are no, to be "inactive". Don't really wee what you're trying to reach with the inclusive gateway. Why not use boundary-events for the time-alerts?

Initially I have used the boundary event but we are getting TimerEntity concurrent exception when we are trying to complete the task when timer job fires, because of this task complete operation is getting rollbacked. To avoid that we have used inclusive gateway and we are not getting that exception. Instead we are getting Null pointer exception but that it not causing the execution flow, I guess.

frederikherema1
Star Contributor
Star Contributor
Completing the task when the timer fires seems to me to be an edge-case (off course, depending on the timeout). If the timeout of a task to be completed is a couple of hours or even days, the chance of the user completing the task when the job is being executed is very small. And if that happens, the ConcurrentModificationException should be handled by your code. In your specific use case it means the user was too late to complete the task, as it's expired already. You'll get similar issues with the inclusive layaway when both event occur, as they both try to update the same process-instance eventually.

Yes, there is a small chance that timer and task complete happen at the same time, but as we have 3 timer boundary events there is a chance that both task complete and one of the time fires at the same time. Problem with timer boundary events is that complete event is getting triggered even though the task complete operation is getting rollback when timer job fires at the same time. As we are sending the notification event as part of complete event, So notification is going even though complete operation is not completed. For that reason we have used the inclusive gateway and we are not facing this issue of complete operation getting rollback even though both fires at the same time, may be because of both are running with different execution id's, I guess.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.