AnsweredAssumed Answered

NullPointerException in Activiti Timer Task

Question asked by alfsender on Dec 22, 2017
Latest reply on Dec 31, 2017 by alfsender

Hi Team,

 

I have a timer task in my workflow. But sometime I am seeing NPE being thrown from Timer Event. Below is stacktrace of error. This is not coming always. Below is my timer event xml. Due to this error my workflow is ended abruptly, and it has moved to history table. When I check in ACT_HI_PROCINST table for my PROC_INST_ID_, I see value of END_TIME_ is NULL.

 

<intermediateCatchEvent id="restoreTimer" name="Restore Timer">
    <documentation>This is a timer task which will keep checking for restore progress.</documentation>
    <timerEventDefinition>
        <timeCycle>R/PT1M</timeCycle>
    </timerEventDefinition>
</intermediateCatchEvent>

java.lang.NullPointerException: null

        at org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler.execute(TimerCatchIntermediateEventJobHandler.java:43) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:85) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.persistence.entity.TimerEntity.execute(TimerEntity.java:95) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.cmd.ExecuteAsyncJobCmd.execute(ExecuteAsyncJobCmd.java:52) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) ~[activiti-spring-5.19.0.2.jar!/:5.19.0.2]

        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]

        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) ~[activiti-spring-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) ~[activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:96) [activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50) [activiti-engine-5.19.0.2.jar!/:5.19.0.2]

        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]

Is there a way to handle this kind of exception?

Regards.

Outcomes