Java Tomcat7状态在windows服务中停止
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23929441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tomcat7 status Stopping in windows service
提问by vivek
I have Apache 2.2 and 4 Tomcat7 instance is running
我有 Apache 2.2 和 4 Tomcat7 实例正在运行
One of the tomcat is configured for 1500 threads and 1024 Mb of Java heap space as the web application require such a deal...
其中一个 tomcat 配置为 1500 个线程和 1024 Mb 的 Java 堆空间,因为 Web 应用程序需要这样的处理......
So at time i face a lot of user traffic and the application gets slow, i restart the tomcat for a fix which in-turn makes the service showing status 'STOPPING'
因此,有时我面临大量用户流量并且应用程序变慢,我重新启动 tomcat 进行修复,这反过来又使服务显示状态“正在停止”
采纳答案by N00b Pr0grammer
If you want to get out of this situation, you could follow the steps as shown below.
如果您想摆脱这种情况,可以按照以下步骤操作。
Open Command prompt (Run as Administrator) on Windows Vista and Win 7
在 Windows Vista 和 Win 7 上打开命令提示符(以管理员身份运行)
Query Service details using the following command (where Tomcat_7.0.7 is the service name of the Tomcat instance):
使用以下命令查询服务详细信息(其中 Tomcat_7.0.7 是 Tomcat 实例的服务名称):
sc queryex Tomcat_7.0.7
You will be able to find the details related to the service (as shown below):
您将能够找到与该服务相关的详细信息(如下所示):
C:\WINDOWS\system32>sc queryex Tomcat_7.0.7
SERVICE_NAME: Tomcat_7.0.7
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x3
WAIT_HINT : 0x0
PID : 2340
FLAGS :
Now get the PID details from the above, use the command as shown below to kill it (to resolve the issue).
现在从上面获取 PID 详细信息,使用如下所示的命令将其杀死(以解决问题)。
taskkill /PID 2340 /F
Thispage gives more details on the same!
此页面提供了更多详细信息!
Hope this helps!
希望这可以帮助!
回答by Mark Thomas
Take a thread dump to find out what part of your application is stopping Tomcat from shutting down cleanly. Provided you are using a reasonably recent Apache Tomcat 7 release, there is an option to generate a thread dump accessible via the configuration tool that sits in the system tray.
进行线程转储以找出应用程序的哪一部分阻止 Tomcat 彻底关闭。如果您使用的是相当新的 Apache Tomcat 7 版本,则可以选择生成可通过系统托盘中的配置工具访问的线程转储。