AnsweredAssumed Answered

Spring autodeploy no job found

Question asked by stejanse on Dec 5, 2011
Latest reply on Nov 26, 2012 by jbarrez
I am using Activiti in my project, mainly to schedule some tasks. Because I use Spring (Roo), I have added the deploymentResources configuration property to automatically start the processes when the war-file is deployed on the application server (jBoss/jetty).

My bean configuration is defined as follows:


<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
   <property name="dataSource" ref="dataSource" />
   <property name="transactionManager" ref="transactionManager" />
   <property name="databaseSchemaUpdate" value="true" />
   <property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
   <property name="jpaHandleTransaction" value="false" />
   <property name="jpaCloseEntityManager" value="false" />
   <property name="jobExecutorActivate" value="true" />
   <property name="deploymentResources" value="classpath:/activiti/deployments/*.bpmn20.xml" />
</bean>

The deployments directory (/activiti/deployments) contains one BPMN file with two processes. Both processes are started by a timed start event. Those events look like this:


<startEvent id="invoicingStart">
   <timerEventDefinition>
      <timeCycle>0 */15 * * * ?</timeCycle>
   </timerEventDefinition>
</startEvent>

The jobs are executed fine (except the known bug with the deploymentResources property that makes the processes deploy again and again at startup) but sometimes an exception is thrown at startup:


org.activiti.engine.ActivitiException: No job found with id '4676'
        at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:54)
        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.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Exception in thread "pool-1-thread-1" org.activiti.engine.ActivitiException: No job found with id '4676'
        at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:54)
        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.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Is someone aware of the cause of this exception?

Thanks in advance.

Outcomes