Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Activiti ProcessEngine when server shuts down #70

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

labkey-tchad
Copy link
Member

Rationale

When a deployApp triggers a server refresh, the WorkflowManager._processEngine can be left initialized with an invalid data source. This causes activiti to flood the server log with errors:

ERROR AcquireTimerJobsRunnable 2024-10-16T13:42:31,420                Thread-39 : exception during timer job acquisition: org/apache/ibatis/exceptions/ExceptionFactory
java.lang.NoClassDefFoundError: org/apache/ibatis/exceptions/ExceptionFactory
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156) ~[mybatis-3.5.13.jar:3.5.13]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.13.jar:3.5.13]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.13.jar:3.5.13]
	at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:443) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:434) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:429) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:412) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.persistence.entity.JobEntityManager.findNextTimerJobsToExecute(JobEntityManager.java:157) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:45) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.cmd.AcquireTimerJobsCmd.execute(AcquireTimerJobsCmd.java:29) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) ~[activiti-engine-5.20.0.jar:5.20.0]
	at org.activiti.engine.impl.asyncexecutor.AcquireTimerJobsRunnable.run(AcquireTimerJobsRunnable.java:52) [activiti-engine-5.20.0.jar:5.20.0]
	at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.ibatis.exceptions.ExceptionFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
	... 17 more

Related Pull Requests

  • N/A

Changes

  • Add a ShutdownListener to clean up WorkflowManager._processEngine

Copy link
Contributor

@labkey-susanh labkey-susanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for tracking down a way out of this bad state.

@labkey-tchad labkey-tchad merged commit 491e950 into develop Oct 17, 2024
3 checks passed
@labkey-tchad labkey-tchad deleted the fb_activityShutdownListener branch October 17, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants