qq_33590434
2021-03-10 18:03
采纳率: 0%
浏览 92

linux系统服务器上tomcat卸载项目

卸载项目名是zaixun_yarn的项目时

tomcat实时日志会报错

[INFO] [2020-12-22 18:17:52] org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.shutdown(208) | Shutting down ExecutorService 'taskScheduler'
[INFO] [2020-12-22 18:17:52] org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.shutdown(208) | Shutting down ExecutorService 'applicationTaskExecutor'
[INFO] [2020-12-22 18:17:52] org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.destroy(597) | Closing JPA EntityManagerFactory for persistence unit 'primaryPersistenceUnit'
[INFO] [2020-12-22 18:17:52] com.zaxxer.hikari.HikariDataSource.close(350) | HikariPool-1 - Shutdown initiated...
[INFO] [2020-12-22 18:17:52] com.zaxxer.hikari.HikariDataSource.close(352) | HikariPool-1 - Shutdown completed.
22-Dec-2020 18:17:52.692 WARNING [http-nio-8083-exec-12] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [zaixun_yarn] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
22-Dec-2020 18:17:52.693 WARNING [http-nio-8083-exec-12] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [zaixun_yarn] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] 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.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
 com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
22-Dec-2020 18:17:53.220 INFO [http-nio-8083-exec-12] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/zaixun_yarn]
22-Dec-2020 18:17:56.060 INFO [mysql-cj-abandoned-connection-cleanup] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. 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 []. 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:1378)
        at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1030)
        at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkThreadContextClassLoader(AbandonedConnectionCleanupThread.java:117)
        at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:84)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
项目确实不能再访问了,可以进行重新部署,但会遇到一个问题,tomcat不会将之前部署项目时的内存释放,如果反复卸载部署的话,内存会一直增加,还会超过在catalina.sh中加的JAVA_OPTS="-Dfile.encoding=UTF-8-server -Xms512m -Xmx3072m"大小,内存占用能达到5,6G,然后偶尔在下一次部署过程中就会导致tomcat内存溢出

 

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • 冯丙见 2021-03-10 18:59

    通过这种方式反复重新加载项目内存很容易出问题,而且基本无解。现在都是应用自服务了,就是内嵌一个Tomcat或者jetty,每次重启服务都连容器一块重启,这样就不会出问题了

    点赞 打赏 评论
  • 有问必答小助手 2021-03-10 19:50

    通过这种方式反复重新加载项目内存很容易出问题,而且基本无解。现在都是应用自服务了,就是内嵌一个Tomcat或者jetty,每次重启服务都连容器一块重启,这样就不会出问题了

    点赞 打赏 评论

相关推荐 更多相似问题