cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear cache?

hadron
Champ in-the-making
Champ in-the-making
Hi, we are running Activiti(5.16.4) on Servicemix(5.3.1)

Upon calling org.activiti.engine.impl.TaskServiceImpl.complete method we have encountered following exception:
[font=Courier][size=8]
Caused by: java.lang.NullPointerException
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.setReplacedBy(ExecutionEntity.java:1067)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityEnd.eventNotificationsCompleted(AtomicOperationActivityEnd.java:134)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.end(ExecutionEntity.java:386)
   at org.activiti.engine.impl.bpmn.behavior.NoneEndEventActivityBehavior.execute(NoneEndEventActivityBehavior.java:24)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   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:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:114)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:440)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.takeAll(ExecutionEntity.java:537)
   at org.activiti.engine.impl.bpmn.behavior.BoundaryEventActivityBehavior.execute(BoundaryEventActivityBehavior.java:63)
   at org.activiti.engine.impl.event.AbstractEventHandler.handleEvent(AbstractEventHandler.java:55)
   at org.activiti.engine.impl.event.SignalEventHandler.handleEvent(SignalEventHandler.java:46)
   at org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity.processEventSync(EventSubscriptionEntity.java:82)
   at org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity.eventReceived(EventSubscriptionEntity.java:73)
   at org.activiti.engine.impl.bpmn.behavior.IntermediateThrowSignalEventActivityBehavior.execute(IntermediateThrowSignalEventActivityBehavior.java:58)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   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:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:621)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:616)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:440)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:418)
   at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:131)
   at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:64)
   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.UserTaskActivityBehavior.signal(UserTaskActivityBehavior.java:139)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:397)
   at org.activiti.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:200)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:50)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:24)
   at org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:59)
   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.TaskServiceImpl.complete(TaskServiceImpl.java:175)
[/size][/font]

Where thrown exception refer to this chunk of code in ExecutionEntity class:

    List<TaskEntity> cachedTasks = dbSqlSession.findInCache(TaskEntity.class);
    for (TaskEntity cachedTask : cachedTasks) {
       if (cachedTask.getExecutionId().equals(this.getId())) {               // line 1067
          allTasks.add(cachedTask);
       }
    }


Which seems as cached list of Task entities containing null object, while this iteration is not prepared to handle it. I tried to restart Servicemix prior to testing my case, hoping the cache could loose this entry, but it still ends with same exception. Is there any other/better way to clear APIs cache?

This occurence happens only in one particular user task created within bpmn process on all of its instances. Possibly, process definition itself is faulty, but i am not able to identify any issues over it.

Thank you for any help
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
No, the cache that is here being used is the session cache, which stores the entities being touched during the API call.
To be honest, i've got the faintest idea how that ever could be null.  Maybe if it is a standalone task (not related to a process definition)
But adding a null check there won't hurt, i believe.

atrif
Champ in-the-making
Champ in-the-making
How about if it is a subtask? Subtasks are not associated with an execution so this will always throw an exception

jbarrez
Star Contributor
Star Contributor
@atrif: not sure what you mean? Can you explain / do you have an example?