<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic NullPointerExceptions for parallel &amp; asynchronous continuation in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38340#M16132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have problems under heavy load (8 requests per second) with our setup. Currently we don't know, what is the cause of the problem, but I will describe our observations. We are using Activiti 5.21.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. NullPointerExceptions in logfile&lt;BR /&gt;2017-05-08T10:40:34.255 ERROR [pool-4-thread-9] Job 46568299 failed&lt;BR /&gt;java.lang.NullPointerException: null&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)&lt;BR /&gt; at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:35)&lt;BR /&gt; at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:85)&lt;BR /&gt; at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:34)&lt;BR /&gt; at org.activiti.engine.impl.cmd.ExecuteAsyncJobCmd.execute(ExecuteAsyncJobCmd.java:52)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;BR /&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)&lt;BR /&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)&lt;BR /&gt; at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:95)&lt;BR /&gt; at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)&lt;BR /&gt; at java.lang.Thread.run(Unknown Source)&lt;BR /&gt;2. Jobs in act_ru_job table with less than 0 retries_ (down to -8)&lt;BR /&gt;3. These jobs contain the message "JobEntity [id=4431434] was updated by another transaction concurrently"&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Exception Stacktrance found in DB:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;org.activiti.engine.ActivitiOptimisticLockingException: JobEntity [id=4431434] was updated by another transaction concurrently&lt;BR /&gt; at org.activiti.engine.impl.db.DbSqlSession$CheckedDeleteOperation.execute(DbSqlSession.java:298)&lt;BR /&gt; at org.activiti.engine.impl.db.DbSqlSession.flushRegularDeletes(DbSqlSession.java:929)&lt;BR /&gt; at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(DbSqlSession.java:895)&lt;BR /&gt; at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:620)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)&lt;BR /&gt; at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;BR /&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)&lt;BR /&gt; at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)&lt;BR /&gt; at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:95)&lt;BR /&gt; at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)&lt;BR /&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)&lt;BR /&gt; at java.lang.Thread.run(Unknown Source)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have one Activiti engine running, with a configured AsyncJobExecutor. The process itself looks as following:&lt;BR /&gt;3 parallel subprocesses, each of them contains a JavaServiceTask and UserTask. The ServiceTasks are all configured as async = true.&lt;BR /&gt;Before and after these parallel processes we have parallel gateways to fork/join. The first parallel gateway is also set to async = true.&lt;BR /&gt;All elements are also exclusive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the feeling, that our configuration is not well set, because 99,9 % of the failing jobs are on the first parallel gateway. But currently I simply don't understand why this happens. I read the section about AsyncJobExecutor as well as the one about Exclusive Jobs. With the knowledge I gained there, I would expect, that such concurrency cannot happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hint is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;BR /&gt;Steffi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 May 2017 09:52:54 GMT</pubDate>
    <dc:creator>sdeutschmann</dc:creator>
    <dc:date>2017-05-22T09:52:54Z</dc:date>
    <item>
      <title>NullPointerExceptions for parallel &amp; asynchronous continuation</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38340#M16132</link>
      <description>Hello everybody!We have problems under heavy load (8 requests per second) with our setup. Currently we don't know, what is the cause of the problem, but I will describe our observations. We are using Activiti 5.21.1. NullPointerExceptions in logfile2017-05-08T10:40:34.255 ERROR [pool-4-thread-9] Job</description>
      <pubDate>Mon, 22 May 2017 09:52:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38340#M16132</guid>
      <dc:creator>sdeutschmann</dc:creator>
      <dc:date>2017-05-22T09:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerExceptions for parallel &amp; asynchronous continuation</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38341#M16133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to use the exclusive flag on any service tasks that flow into the join.&lt;/P&gt;&lt;P&gt;Likely this is the cause of your problem.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 May 2017 17:40:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38341#M16133</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-22T17:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerExceptions for parallel &amp; asynchronous continuation</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38342#M16134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;I already have the exclusive flag set on all my service tasks. That's why I don't understand why that happens. I would expect, that all tasks marked as exclusive are executed by one thread, so that I don't get problems with concurrency.&lt;/P&gt;&lt;P&gt;Regards, Steffi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 06:39:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38342#M16134</guid>
      <dc:creator>sdeutschmann</dc:creator>
      <dc:date>2017-05-23T06:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerExceptions for parallel &amp; asynchronous continuation</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38343#M16135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing same type of problem, is this resolved ? if yes, can you please share fix for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 05:23:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38343#M16135</guid>
      <dc:creator>jdp</dc:creator>
      <dc:date>2018-06-20T05:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerExceptions for parallel &amp; asynchronous continuation</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38344#M16136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paresh,&lt;/P&gt;&lt;P&gt;in our case it seemed to be indeed wrong configuration. Accidentally we set lower values than the default ones for these variables (we forgot one 0):&lt;/P&gt;&lt;UL style="color: #333333; background-color: #ffffff; font-size: 14px;"&gt;&lt;LI&gt;&lt;CODE&gt;activiti.asyncExecutor.timer.lockTime.millis&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;activiti.asyncExecutor.asyncJob.lockTime.millis&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When we were setting them to the default value of 300.000, everything runs smooth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other problem we had at the beginning was caused by our database configuration: It was not vacuumed regularly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 06:31:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nullpointerexceptions-for-parallel-asynchronous-continuation/m-p/38344#M16136</guid>
      <dc:creator>sdeutschmann</dc:creator>
      <dc:date>2018-06-20T06:31:08Z</dc:date>
    </item>
  </channel>
</rss>

