<?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 Re: Retry failed job and duedate/lockExpirationDate in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164249#M117999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry i forgot the link to the referenced JIRA : &lt;/SPAN&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1046" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1046&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2014 15:51:24 GMT</pubDate>
    <dc:creator>mapor</dc:creator>
    <dc:date>2014-05-05T15:51:24Z</dc:date>
    <item>
      <title>Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164248#M117998</link>
      <description>Hello,I'm trying to write a class in order to retry failed job with a delay, in my command i use the following lines :  public Object execute(CommandContext commandContext) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this.jobId==null){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOGGER.error("no job id given");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IllegalArgumentException();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Job</description>
      <pubDate>Mon, 05 May 2014 15:43:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164248#M117998</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-05T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164249#M117999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry i forgot the link to the referenced JIRA : &lt;/SPAN&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1046" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1046&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 15:51:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164249#M117999</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-05T15:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164250#M118000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This issue is fixed in Activiti 5.10. Are you using an older version? I would really recommend to upgrade to a more recent version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:53:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164250#M118000</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-05-06T13:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164251#M118001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using the version 5.15.1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 17:11:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164251#M118001</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-06T17:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164252#M118002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How did you plugin your custom job functionality in the Activiti Engine?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 08:18:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164252#M118002</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-05-08T08:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164253#M118003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;With psring injection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The class&amp;nbsp; implements Command&amp;lt;Object&amp;gt; and FailedJobCommandFactory by returning a new instance of himself with the given parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;property name="failedJobCommandFactory"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean class="com.alstom.userportal.workflow.bean.RetryJobExecutor" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public Command&amp;lt;Object&amp;gt; getCommand(String arg0, Throwable arg1) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return new RetryJobExecutor(arg0, arg1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a breakpoint i'm sure that i pass in the execute method but still data in database are not fullfilled / resetted (lockOwner) correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 12:37:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164253#M118003</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-12T12:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164254#M118004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your implementation I see the following line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Context.getCommandContext()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You already have a command context available, so you should be using that one. Don't know if this solves the issue though. Let me know if the issue is still there and we'll do some testing for it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 19:32:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164254#M118004</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-05-14T19:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164255#M118005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still doesn't work, the columns due_date and lock_exp_time are still empty even when the following code is executed : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; job.setLockExpirationTime(date);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; job.setDuedate(date);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Job status in the database : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"525";15;"message";"";"";TRUE;"523";"409";"AppstoreRequest:5:408";0;"528";"Error while evaluating expression: #{appstoreDelegate.createITSM7Request(requestDelegated, computerId, packageId)}";"";"";"async-continuation";"";"''"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe my change are absolutely not persisted while the exception message have already been set by something else somewhere ?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With breakpoints i'm sure that my RetryJobExecutor is executed and not the DecrementJobRetriesCmd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 08:58:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164255#M118005</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-15T08:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164256#M118006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any news ? Or should i go for a custom cron job that retry job outside the context of activiti ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 12:29:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164256#M118006</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-22T12:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164257#M118007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, im quite puzzled. it could indeed be that the exception takes over and removes your changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any chance you can put your custom job factory in a small unit test that demonstrates the issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 07:24:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164257#M118007</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-05-27T07:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164258#M118008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried and something interesting showed up : when my job failed i get into my custom failed job executor but a exception is still throw&amp;nbsp; : "job xx failed" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that means that with my current code the error of my job is rethrowed after my RetryJobExecutor instead of being schedule later. And since a exception means that the transaction will rollback…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like i forgot something that make the exception not being rethrowed by activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For my junit i just use manageService.executeJob and my delegate always throw &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If i look in the DecrementJobRetriesCmd i can see that piece of code : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TransactionContext transactionContext = commandContext.getTransactionContext();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what i understood when i red about that, it was that code that make the job being retry immediately, so i removed it. I tried to put it again but the exception is still rethrowed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit : in inspected the code more deeply and in fact i have a NPE at job.setLockOwner(null); in my RetryJobExecutor the variable job is null, but the variable jobId is "26". So that means that i have an ID of a job that is not present anymore in the database. That NPE is not present in the given stacktrace. I have the first exception that have been throw by my delegate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NB : my jobs are asynchronous service task with delegate expression if it's help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 08:44:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164258#M118008</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-27T08:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164259#M118009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code you posted is using a transaction listener - hence the code will be executed just before the transaction actually commits to the database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Seems like i forgot something that make the exception not being rethrowed by activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sounds like it indeed. However, im not sure if thats pluggable actually … would need some investigation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 08:52:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164259#M118009</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-05-27T08:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164260#M118010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;as i said in my edit, i got a NPE in my job executor., the variable job is null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The&amp;nbsp; jobid that activiti gave me is not found. I don't know why because when i ran it from my application the job is found.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use a hsql db in memory for my junit tests&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 09:01:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164260#M118010</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-05-27T09:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164261#M118011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; I use a hsql db in memory for my junit tests&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The db shouldn't make a difference normally. Could you share that unit test that is failing, cause its hard to follow without knowing what all is happening.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 08:33:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164261#M118011</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-05-30T08:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164262#M118012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;here : &lt;/SPAN&gt;&lt;A href="http://www.fichier-zip.com/2014/06/02/activiti-unit-test-template-master/" rel="nofollow noopener noreferrer"&gt;http://www.fichier-zip.com/2014/06/02/activiti-unit-test-template-master/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used two BPNM model just in case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the code : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; JobEntity job = Context&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCommandContext()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getJobEntityManager()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findJobById(jobId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;still throw a NPE if i use the variable commandContenxt.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2014 14:47:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164262#M118012</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-06-02T14:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164263#M118013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the unit test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It took my quite some puzzling to see whats going on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First off all, you should disable the jobExecutor in the activiti cfg. It is interfering with your regular executeJobs() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Secondly, the real issue here is that the Test case is marked with @Transactional.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The whole test will be executed in one single transaction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The .findJobById(jobId); will always return null: the data has never ever been committed to the database. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Once I removed the&amp;nbsp; @transactional, the NPE was gone.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 20:41:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164263#M118013</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-06-04T20:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164264#M118014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the NPE fix. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But now i have the main problem that produce in my application (i checked and i didn't have the NPE in the application) : if a put a breakpoint within that code in WorkflowFailTest.java : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for(Job job : list){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; StringBuilder builder = new StringBuilder();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; builder.append(job.getId()).append("/")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; .append(job.getRetries()).append("/")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; .append(job.getExceptionMessage());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; LOGGER.info(builder.toString());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can see that the dueDate is null or it shouldn't since i setted one in my RetryJobExecutor and while i'm waiting when the breakpoint is active the job are executing endlessly since i'm not decreasing the ammount of retries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 10:07:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164264#M118014</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-06-11T10:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164265#M118015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; I can see that the dueDate is null or it shouldn't since i setted one in my RetryJobExecutor and while i'm waiting when the breakpoint is active the job are executing endlessly since i'm not decreasing the ammount of retries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im sorry, i tried very hard … but can't understand what you are trying to say. Breakpointing in a multi threaded environment is hard, and will give you different results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 10:19:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164265#M118015</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-06-17T10:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164266#M118016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well since i use the manager in order to execute all job synchronously in the junit test, the whole thing should be only in one thread no ? And so reading the jobs after execute them should give result up to date (and so with a due date set to current time + 10mn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What i'm trying to say is that the setDueDate() used in my RetryJobExecutpor is not persisted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or maybe there is some hidden rules like only timer activity can have dueDate and so can't be used for all kind of jobs to schedule next try ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the end i just search how to prevent for immediate retry of a job that has failed and control when it will be executed again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 15:44:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164266#M118016</guid>
      <dc:creator>mapor</dc:creator>
      <dc:date>2014-06-17T15:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Retry failed job and duedate/lockExpirationDate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164267#M118017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; Or maybe there is some hidden rules like only timer activity can have dueDate and so can't be used for all kind of jobs to schedule next try ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, any jobEntity can have it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The last resort you can try: is the JobEntity part of the DbSQLSession.flush()? Setting the due date should mark the entity as dirty, and make it flush at the end of the transaction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 12:31:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/retry-failed-job-and-duedate-lockexpirationdate/m-p/164267#M118017</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-06-27T12:31:18Z</dc:date>
    </item>
  </channel>
</rss>

