AnsweredAssumed Answered

NullPointerException ExecuteAsyncRunnable

Question asked by javacorner on Apr 13, 2016
Latest reply on May 1, 2016 by javacorner
Dears ,
for your help please .

I face

<blockcode>
[4/13/16 7:33:48:110 AST] 00000275 SystemOut     O Wed Apr 13 07:33:48 2016 ERROR ExecuteAsyncRunnable - Job 355436 failed
java.lang.NullPointerException
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:35)
   at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:85)
   at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:34)
   at org.activiti.engine.impl.cmd.ExecuteAsyncJobCmd.execute(ExecuteAsyncJobCmd.java:52)
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:96)
   at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
   at java.lang.Thread.run(Thread.java:863)
</blockcode>
<br/>
I am running following process :

<process id="offlineProcess" name="offline statement Process" isExecutable="true">
    <extensionElements>
      <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
    </extensionElements>
    <startEvent id="startevent1" name="Start">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </startEvent>
    <callActivity id="exportactivity" name="Call activity of export" activiti:async="true" calledElement="offStmtCallActivity">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </callActivity>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="exportactivity"></sequenceFlow>
    <endEvent id="endevent1" name="End">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow2" sourceRef="exportactivity" targetRef="endevent1"></sequenceFlow>
  </process>

<br/>
the call activity is

<process id="offStmtCallActivity" name="offStmtCallActivity" isExecutable="true">
    <startEvent id="starteoffStmtCallActivity" name="Start offline Statement Call Activity" activiti:initiator="${mwUserID}">
      <documentation>Start offline Statement Call Activity</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </startEvent>
    <sequenceFlow id="startflow" sourceRef="starteoffStmtCallActivity" targetRef="initialize"></sequenceFlow>
    <endEvent id="endnoRecords" name="End">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <serviceTask id="initialize" name="initialize" activiti:class="me.ffusion.bpm.javaDelegates.Initialize">
      <documentation>Initialize logger and create working directory</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="frominitializeFlow" sourceRef="initialize" targetRef="GetNextPage">
      <documentation>from initialize Flow</documentation>
    </sequenceFlow>
    <sequenceFlow id="PagedFailFlow" name="Fail" sourceRef="GetNextPage" targetRef="startTimerTrns">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${getPage== "fail"}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="pagedTerminateFlow" name="terminate" sourceRef="GetNextPage" targetRef="endnoRecords">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${getPage== "terminate"}]]></conditionExpression>
    </sequenceFlow>
    <serviceTask id="startTimerTrns" name="start timer" activiti:class="me.ffusion.bpm.javaDelegates.StartTimerTrns"></serviceTask>
    <sequenceFlow id="retrievedFlow" name="all trns retrieved" sourceRef="GetNextPage" targetRef="exportReport">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${getPage== "allRetrieved"}]]></conditionExpression>
    </sequenceFlow>
    <serviceTask id="GetNextPage" name="Get trns from backend" default="retrievedFlow" activiti:class="me.ffusion.bpm.javaDelegates.GetNextRecordsPage">
      <documentation>Get next page of account statement from BE service</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <serviceTask id="exportReport" name="export trns report" activiti:class="me.ffusion.bpm.javaDelegates.ExportJasperReport">
      <documentation>export transactions report object</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow25" sourceRef="exportReport" targetRef="emailReport"></sequenceFlow>
    <serviceTask id="startTimerEmail" name="start timer" activiti:class="me.ffusion.bpm.javaDelegates.StartTimerEmail"></serviceTask>
    <sequenceFlow id="flow35" sourceRef="startTimerEmail" targetRef="waitTimerSendEmail"></sequenceFlow>
    <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway>
    <sequenceFlow id="flow30" name="sent or terminate" sourceRef="exclusivegateway3" targetRef="endnoRecords">
      <extensionElements>
        <activiti:executionListener event="take" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${emailsent== true}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow31" name="retry" sourceRef="exclusivegateway3" targetRef="startTimerEmail">
      <extensionElements>
        <activiti:executionListener event="take" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${emailsent==false}]]></conditionExpression>
    </sequenceFlow>
    <serviceTask id="emailReport" name="email report" activiti:class="me.ffusion.bpm.javaDelegates.EmailReport">
      <documentation>email report to partner</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow29" sourceRef="emailReport" targetRef="exclusivegateway3"></sequenceFlow>
    <receiveTask id="waitTimerSendEmail" name="wait Timer to retry">
      <documentation>waitTimerSendEmail</documentation>
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </receiveTask>
    <sequenceFlow id="flow32" sourceRef="waitTimerSendEmail" targetRef="emailReport"></sequenceFlow>
    <receiveTask id="waitTimerPaged" name="wait timer to retry">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.InmaEventListener"></activiti:executionListener>
      </extensionElements>
    </receiveTask>
    <sequenceFlow id="flow36" sourceRef="startTimerTrns" targetRef="waitTimerPaged"></sequenceFlow>
    <sequenceFlow id="flow37" sourceRef="waitTimerPaged" targetRef="GetNextPage"></sequenceFlow>
  </process>

<br/>
Also I have 2 another processes that are timers :
frost timer process

<process id="timerCleanupTrns" name="timerCleanupTrns" isExecutable="true">
    <startEvent id="timerstartCleanupTrns" name="Timer start">
      <timerEventDefinition>
        <timeDuration>PT20M</timeDuration>
      </timerEventDefinition>
    </startEvent>
    <serviceTask id="cleanupTask" name="cleanupTask" activiti:class="me.ffusion.bpm.javaDelegates.CleanupTrns">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.TimerEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" sourceRef="timerstartCleanupTrns" targetRef="cleanupTask"></sequenceFlow>
    <endEvent id="endCleanupTrns" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="cleanupTask" targetRef="endCleanupTrns"></sequenceFlow>
  </process>

Second timer process

<process id="timerCleanupEmail" name="timerCleanupEmail" isExecutable="true">
    <startEvent id="timerstartCleanupEmail" name="Timer start">
      <timerEventDefinition>
        <timeDuration>PT20M</timeDuration>
      </timerEventDefinition>
    </startEvent>
    <serviceTask id="cleanupTask" name="cleanupTask" activiti:expression="me.ffusion.bpm.javaDelegates.CleanupEmail">
      <extensionElements>
        <activiti:executionListener event="start" class="me.ffusion.bpm.listeners.TimerEventListener"></activiti:executionListener>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" sourceRef="timerstartCleanupEmail" targetRef="cleanupTask"></sequenceFlow>
    <endEvent id="endCleanupEmail" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="cleanupTask" targetRef="endCleanupEmail"></sequenceFlow>
  </process>


I am using aciviti 5.19.2

Outcomes