Tomcat 9热部署每次都会失败

问题描述 投票:0回答:1

环境:

  • Grails 4.0.0
  • Java 11
  • Tomcat 9.0.26
  • Ubuntu 18.04

为了完整起见,我正在Windows 7上进行战争。每次重新部署都会失败,并显示以下输出。 Tomcat更新对其进行了修复。

22-Sep-2019 10:46:40.894 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/mywarfile]
22-Sep-2019 10:46:40.968 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [Tomcat JDBC Pool Cleaner[148407186:1569148582277]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:553)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:40.969 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
 [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 [email protected]/java.lang.Thread.run(Thread.java:834)
22-Sep-2019 10:46:40.970 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:527)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:40.970 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:527)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:40.971 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:527)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:40.972 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:527)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:40.972 WARNING [Catalina-utility-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [mywarfile] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 [email protected]/java.util.TimerThread.mainLoop(Timer.java:527)
 [email protected]/java.util.TimerThread.run(Timer.java:506)
22-Sep-2019 10:46:41.027 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/mywarfile.war]
22-Sep-2019 10:46:42.325 INFO [Abandoned connection cleanup thread] 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:1385)
                at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1038)
                at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
                at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                at java.base/java.lang.Thread.run(Thread.java:834)
2019-09-22 10:46:46.310 [Catalina-utility-1] INFO  com.mywarfile.ApplicationLoader:650 - The following profiles are active: production

Configuring Spring Security Core ...
... finished configuring Spring Security Core

2019-09-22 10:46:57.027 [Catalina-utility-1] INFO  com.mywarfile.ApplicationLoader:59 - Started ApplicationLoader in 11.646 seconds (JVM running for 664.082)
22-Sep-2019 10:46:57.100 INFO [Catalina-utility-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
22-Sep-2019 10:46:57.123 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/mywarfile.war] has finished in [16,096] ms
java tomcat grails java-11 tomcat9
1个回答
0
投票

mysql驱动程序正在尝试在Web应用程序关闭时进行清理,这很好。不幸的是,它试图加载其他类来执行此清理,并且-由于Web应用程序正在关闭-类加载不再可用。理想情况下,驱动程序将在首次加载时加载其需要清理的所有类,这可以避免此问题。

[如果您能确定它正在尝试加载哪些类-检查驱动程序源代码应显示给您哪个-那么您应该能够在应用程序启动时自行加载它们,例如ServletContextListener。] >

© www.soinside.com 2019 - 2024. All rights reserved.