AnsweredAssumed Answered

Stopping Job Executor

Question asked by arkadi on Sep 1, 2011
Latest reply on Sep 2, 2011 by frederikheremans1
Is there a way to stop Job Executor <property name="jobExecutorActivate" value="true" /> nicely at webapp context shutdown? We have a listener:
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
       if (processEngine != null)
            ProcessEngines.destroy();
    }
but then later:
2011.1.9 22:19:31 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load org.apache.ibatis.exceptions.ExceptionFactory.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1562)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77)
   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:191)
   at org.activiti.engine.impl.persistence.entity.JobManager.findNextJobsToExecute(JobManager.java:97)
   at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:49)
   at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:32)
   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.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)
2011.1.9 22:19:31 org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already.  Could not load org/apache/ibatis/exceptions/ExceptionFactory.class.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
Exception in thread "JobAcquisitionThread" java.lang.NoClassDefFoundError: org/apache/ibatis/exceptions/ExceptionFactory
   at org.apache.ibatis.session.defaults.DefaultSqlSession.close(DefaultSqlSession.java:169)
   at org.activiti.engine.impl.db.DbSqlSession.close(DbSqlSession.java:450)
   at org.activiti.engine.impl.interceptor.CommandContext.closeSessions(CommandContext.java:154)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:126)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:63)
And I believe the JobAcquisitionThread must be also setup as daemon thread, but currently it is not.

Outcomes