cancel
Showing results for 
Search instead for 
Did you mean: 

Null Pointer Exception when executing parallel fork service

vram
Champ in-the-making
Champ in-the-making
Hi,

When trying to execute the work flow as below with service tasks , I get a null pointer exception as :

java.lang.NullPointerException
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:34)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
   at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:35)
   at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:78)
   at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:31)
   at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:61)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


When I use a script task in places of service task in above, I do not get any exceptions and the work flow completes to success. Any pointers would greatly help me…

Thanks
8 REPLIES 8

frederikherema1
Star Contributor
Star Contributor
I presume you're running the tasks asynchronously, non-exclusive now? Again, it's recommended to join the two flows again and also take into account http://activiti.org/userguide/index.html#exclusiveJobs.

What I presume that is happening, is that both service-tasks are executed at the same time, and both updating the main process-instance.

vram
Champ in-the-making
Champ in-the-making
Thanks a lot frederikheremans for your recommendation.

After the locking exception in the retry again I see this exception :

java.lang.NullPointerException
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:34)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:35)
at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:78)
at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:31)
at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:61)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Is this also a effect of not using a join ?

frederikherema1
Star Contributor
Star Contributor
Not really sure what is happening here… The line the NPE occur on contains this:


ActivityImpl activity = (ActivityImpl) execution.getActivity();

So execution is null, which generally means bad news. Can you create a failing unit-test showing this behavior, so I can see the full test and process that is causing this?

michael_amann
Champ in-the-making
Champ in-the-making
Hi frederikheremans,

I am facing the same issue as discussed here.

Whenever I throw a RuntimeException within the ServiceTask (called via Expression) and then try to recover from this error by signaling the execution, I see the following NPE from the line:

    SignallableActivityBehavior activityBehavior = (SignallableActivityBehavior) activity.getActivityBehavior();

Stack trace:

java.lang.NullPointerException
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:362)
at org.activiti.engine.impl.cmd.SignalCmd.execute(SignalCmd.java:60)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
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:33)
at org.activiti.engine.impl.RuntimeServiceImpl.signal(RuntimeServiceImpl.java:137)


It would be great if you could give me a hint on how to continue the process or even better, retry and continue.

Thanks
Michael

lior1
Champ in-the-making
Champ in-the-making
Hi Michael,

I'm facing the same issue. Did you manage to solve the problem or workaround it?

Thanks,

Lior

frederikherema1
Star Contributor
Star Contributor
Try using a parrallel-gateway (join) after the 2 paths…

javacorner
Champ in-the-making
Champ in-the-making
Hi frederikheremans,
please find the attached diagram
I face same error
I do not know how to join tasks in the diagram ?

<code>
Tue Sep 15 12:23:34 2015 ERROR JobRetryCmd - activitiy or FailedJobRetryTimerCycleValue is null in job 127997'. only decrementing retries.
Tue Sep 15 12:23:34 2015 ERROR InmaEventListener - ACTIVITI The execution of a job has failed. EntityId=127997 ,JobHandlerType=async-continuation ,ProcessInstanceId=127994
Tue Sep 15 12:23:34 2015 ERROR InmaEventListener - ACTIVITI The execution of a job has failed. EntityId=127997 ,JobHandlerType=async-continuation ,ProcessInstanceId=127994
Tue Sep 15 12:23:34 2015 ERROR ExecuteAsyncRunnable - Job 127997 failed
java.lang.NullPointerException
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:35)
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:84)
at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:29)
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.run(ExecuteAsyncRunnable.java:73)
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:801)</code>

javacorner
Champ in-the-making
Champ in-the-making
Dears
is this is a bug that fixed at 5.18?

I found at re;lease notes [http://www.activiti.org/readme.html] the following
Bug:
[ACT-2194] - NPE when using parallel multi-instance on embedded subprocess
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.