cancel
Showing results for 
Search instead for 
Did you mean: 

Spring autodeploy no job found

stejanse
Champ in-the-making
Champ in-the-making
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.
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

Do you only run one instance of the Activiti Engine? Or are you using the Activiti Explorer and the Activiti REST web application?
This error seems to tell that the job is already completed and that's possible when multiple Activiti Engines are running.

Best regards,

stejanse
Champ in-the-making
Champ in-the-making
Yes, I am running only one Activiti Engine I am aware of. Only the custom application runs the Activiti Engine. Is it possible that Spring deploys two Activiti Engines?

danielbreitner
Champ in-the-making
Champ in-the-making
Hi,

I am experiencing  a simlar behaviour (activiti 5.10) - we have two processes with a timeCycle, we use spring and sometimes this exact exception occurs.  Sometimes it does not do any harm, sometimes one of the processes just "disappears".

Here´s the exception:

rg.activiti.engine.ActivitiException: No job found with id '479185'
       at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:58)
       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:46)
       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)
xception in thread "pool-2-thread-8" org.activiti.engine.ActivitiException: No job found with id '479185'
       at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:58)
       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:46)
       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)

jbarrez
Star Contributor
Star Contributor
Like Tijs said above, how many engines are you running on the same database?

It seems the job is gone, being executed by another job executor. On itself the error is 'to be expected' when you have multiple job executors, but it might also be a bootstrap problem in Spring we haven't found.