# Exception in Asynchronous thread

**URL:** <https://forum.flowable.org/t/exception-in-asynchronous-thread/701>\
**Category:** Uncategorized\
**Created:** [July 6, 2017, 9:10am UTC](https://forum.flowable.org/t/exception-in-asynchronous-thread/701 "2017-07-06T09:10:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vibhu08](https://avatars.discourse-cdn.com/v4/letter/v/ac8455/32.png) [@vibhu08](https://forum.flowable.org/u/vibhu08)\
**Post date:** [July 6, 2017, 9:10am UTC](https://forum.flowable.org/t/exception-in-asynchronous-thread/701/1 "2017-07-06T09:10:53Z")

</div>

Exception in thread “flowable-async-job-executor-thread-2” java.lang.NullPointerException  
at org.flowable.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:142)  
at org.flowable.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:35)  
at org.flowable.engine.impl.persistence.entity.AbstractEntityManager.delete(AbstractEntityManager.java:89)  
at org.flowable.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:128)  
at org.flowable.engine.impl.persistence.entity.JobEntityManagerImpl.delete(JobEntityManagerImpl.java:35)  
at org.flowable.engine.impl.persistence.entity.AbstractEntityManager.delete(AbstractEntityManager.java:84)  
at org.flowable.engine.impl.asyncexecutor.DefaultJobManager.unacquire(DefaultJobManager.java:284)  
at org.flowable.engine.impl.asyncexecutor.ExecuteAsyncRunnable$3.execute(ExecuteAsyncRunnable.java:168)  
at org.flowable.engine.impl.asyncexecutor.ExecuteAsyncRunnable$3.execute(ExecuteAsyncRunnable.java:166)  
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:44)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:86)  
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:65)  
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:49)  
at org.flowable.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:51)  
at org.flowable.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:64)  
at org.flowable.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:36)  
at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)  
at org.flowable.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)  
at org.flowable.engine.impl.asyncexecutor.ExecuteAsyncRunnable.unacquireJob(ExecuteAsyncRunnable.java:166)  
at org.flowable.engine.impl.asyncexecutor.ExecuteAsyncRunnable.lockJobIfNeeded(ExecuteAsyncRunnable.java:153)  
at org.flowable.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:72)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

---

<div class="post-metadata">

**Author:** ![vibhu08](https://avatars.discourse-cdn.com/v4/letter/v/ac8455/32.png) [@vibhu08](https://forum.flowable.org/u/vibhu08)\
**Post date:** [July 6, 2017, 9:13am UTC](https://forum.flowable.org/t/exception-in-asynchronous-thread/701/2 "2017-07-06T09:13:48Z")

</div>

My process definiton  
I am invoking restful web service in service task(Work to be done).So when the response from system is too late it breaks the time cycle .Is there any better way of invoking a restful service in Flowable.

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/8e6509496d3c02ab5319cc50214cbba554d2b851.PNG)
