Tomcat 没有完全停止

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

我无法停止 Windows 服务器上的 Tomcat 服务;它显示停止。我必须从任务计划程序中手动终止该进程。如何解决这个问题?

我在 Catalina 日志中收到以下错误

10-Dec-2023 04:33:17.744 INFO [Thread-2881] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
10-Dec-2023 04:33:18.708 INFO [Thread-2881] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["https-jsse-nio-8443"]
10-Dec-2023 04:33:19.083 INFO [Thread-2881] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
10-Dec-2023 04:33:19.130 INFO [Thread-2881] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
10-Dec-2023 04:33:25.896 INFO [Thread-2881] com.sun.xml.ws.transport.http.servlet.WSServletDelegate.destroy WSSERVLET15: JAX-WS servlet destroyed
10-Dec-2023 04:33:26.849 INFO [Thread-2881] com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextDestroyed WSSERVLET13: JAX-WS context listener destroyed
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [File Watcher] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
 com.documentum.fc.common.DfFileWatcher.run(DfFileWatcher.java:58)
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [SessionDestroyer-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
 com.adecco.edoc.core.session.SessionDestroyer.run(SessionDestroyer.java:44)
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [SessionDestroyer-1401] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
 com.adecco.edoc.core.session.SessionDestroyer.run(SessionDestroyer.java:44)
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [SessionDestroyer-1898] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
 com.adecco.edoc.core.session.SessionDestroyer.run(SessionDestroyer.java:44)
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [SessionDestroyer-2025] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
 com.adecco.edoc.core.session.SessionDestroyer.run(SessionDestroyer.java:44)
10-Dec-2023 04:33:27.036 WARNING [Thread-2881] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [espaceperso] appears to have started a thread named [SessionDestroyer-2012] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Thread.sleep(Native Method)
windows tomcat memory memory-leaks windows-server
1个回答
0
投票

您看到的这些消息来自 Tomcat 的泄漏检测系统。它们表明您的应用程序(或您正在使用的库)已创建线程,这些线程将在应用程序停止后继续运行。

正确的解决方案是确保您的应用程序停止这些线程,通常通过注册

ServletContextListener
来在上下文被“破坏”(应用程序关闭)时清理事物。

您可能会发现某些库附带侦听器和/或“关闭库”命令。您应该安排这些在应用程序关闭时运行。

Tomcat 确实没有任何方法可以为您完成此操作,您必须自己完成。

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