axelor / axelor-open-platform

Open source Java framework for business application development
http://axelor.com
Other
391 stars 298 forks source link

When disabling axelor #123

Closed Tariel27 closed 12 months ago

Tariel27 commented 1 year ago

Нello, when I want to restart applications (to update several files and so on), tomcat refuses to launch the container, and swears at memory leaks, after reading the logs a little, I realized that there is a conflict inside, I will be grateful for any help

As I understand it, the problem is in "ViewWatcher".

  1. Use Case 1.1. When disable app in tomcat

  2. Versions

    • JDK: 1.8.0_202-b08
    • appVersion: 6.3.10
    • openPlatformVersion: 5.4.17
    • Apache Tomcat: 9.0.70
    • Windows 10
    • Chrome
  3. Logs

    
    09-Mar-2023 11:19:33.773 WARNING [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [axelor-erp-6.3.10] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    09-Mar-2023 11:19:33.773 WARNING [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [axelor-erp-6.3.10] appears to have started a thread named [Thread-6] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus0(Native Method)
    sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus(Unknown Source)
    sun.nio.fs.WindowsWatchService$Poller.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    09-Mar-2023 11:19:33.773 WARNING [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [axelor-erp-6.3.10] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    sun.misc.Unsafe.park(Native Method)
    java.util.concurrent.locks.LockSupport.park(Unknown Source)
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
    java.util.concurrent.LinkedBlockingDeque.takeFirst(Unknown Source)
    java.util.concurrent.LinkedBlockingDeque.take(Unknown Source)
    sun.nio.fs.AbstractWatchService.take(Unknown Source)
    com.axelor.meta.loader.ViewWatcher.handleEvents(ViewWatcher.java:183)
    com.axelor.meta.loader.ViewWatcher.lambda$start$19(ViewWatcher.java:467)
    com.axelor.meta.loader.ViewWatcher$$Lambda$204/1116423796.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    09-Mar-2023 11:19:33.773 WARNING [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [axelor-erp-6.3.10] appears to have started a thread named [Camunda BPM Runtime Telemetry Reporter] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    java.lang.Object.wait(Native Method)
    java.util.TimerThread.mainLoop(Unknown Source)
    java.util.TimerThread.run(Unknown Source)
    09-Mar-2023 11:19:33.773 WARNING [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [axelor-erp-6.3.10] appears to have started a thread named [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
    java.lang.Object.wait(Native Method)
    org.camunda.bpm.engine.impl.jobexecutor.AcquireJobsRunnable.suspendAcquisition(AcquireJobsRunnable.java:51)
    org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:104)
    java.lang.Thread.run(Unknown Source)
    09-Mar-2023 11:19:33.788 SEVERE [Thread-11] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [axelor-erp-6.3.10] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@58cdc367]) and a value of type [org.hibernate.internal.SessionImpl] (value [SessionImpl(<closed>)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    09-Mar-2023 11:19:33.804 INFO [Thread-11] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
    09-Mar-2023 11:19:33.819 INFO [Thread-11] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
    09-Mar-2023 11:20:18.636 INFO [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [org.apache.ibatis.logging.jdbc.ConnectionLogger]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.ibatis.logging.jdbc.ConnectionLogger]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1432)
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1420)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1259)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
        at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:339)
        at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:89)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
        at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$executeSelectList$1(DbSqlSession.java:111)
        at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:254)
        at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.executeSelectList(DbSqlSession.java:111)
        at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:103)
        at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectListWithRawParameter(DbEntityManager.java:182)
        at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:174)
        at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:170)
        at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:159)
        at org.camunda.bpm.engine.impl.persistence.entity.JobManager.findNextJobsToExecute(JobManager.java:238)
        at org.camunda.bpm.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:66)
        at org.camunda.bpm.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:44)
        at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
        at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
        at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.acquireJobs(SequentialJobAcquisitionRunnable.java:164)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:80)
        at java.lang.Thread.run(Unknown Source)
    09-Mar-2023 11:20:18.636 INFO [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [org.camunda.bpm.engine.TaskAlreadyClaimedException]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.camunda.bpm.engine.TaskAlreadyClaimedException]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1432)
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1420)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1259)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.shouldLogInfo(CommandContext.java:240)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:213)
        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:119)
        at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
        at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.acquireJobs(SequentialJobAcquisitionRunnable.java:164)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:80)
        at java.lang.Thread.run(Unknown Source)
    09-Mar-2023 11:20:18.636 INFO [JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [ch.qos.logback.classic.spi.ThrowableProxy]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [ch.qos.logback.classic.spi.ThrowableProxy]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1432)
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1420)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1259)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
        at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
        at ch.qos.logback.classic.Logger.debug(Logger.java:494)
        at org.camunda.commons.logging.BaseLogger.logDebug(BaseLogger.java:185)
        at org.camunda.bpm.engine.impl.cmd.CommandLogger.maskedExceptionInCommandContext(CommandLogger.java:106)
        at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.trySetThrowable(CommandInvocationContext.java:71)
        at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:227)
        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:119)
        at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
        at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.acquireJobs(SequentialJobAcquisitionRunnable.java:164)
        at org.camunda.bpm.engine.impl.jobexecutor.SequentialJobAcquisitionRunnable.run(SequentialJobAcquisitionRunnable.java:80)
        at java.lang.Thread.run(Unknown Source)