我在基于 32 位操作系统的 tomcat 上运行了 java web 应用程序,启动和停止 tomcat 大约需要 2-4 秒。我已经将 JRE、Tomcat 升级到 64 位并且 tomcat 服务启动快速或正常,因为它开始但停止了 1 分钟,这很长而且我很好奇停止的时间或者它被 Windows 服务管理器杀死,因为太停止时间长。
Web 应用程序正在运行用于 Rest API 的 Spring 框架和用于 http 通信的 pubnub SDK,我认为它不应该在库的 32 位和 64 位环境之间产生差异。此外,WEB 应用程序正在运行一些后台任务,但没有复杂的任务......
tomcat 停止那么慢可能是什么问题?尝试使用 32 位 jdk 和 64 位 jdk 编译该应用程序,但结果相同。
[2018-04-04 17:49:21] [info] ( prunsrv.c:984 ) [ 2460] Stopping service...
[2018-04-04 17:49:21] [debug] ( javajni.c:937 ) [ 864] argv[0] = stop
[2018-04-04 17:49:21] [debug] ( javajni.c:990 ) [ 864] Java Worker thread started org/apache/catalina/startup/Bootstrap:main
[2018-04-04 17:49:21] [debug] ( javajni.c:1013) [ 3336] Java Worker thread finished org/apache/catalina/startup/Bootstrap:main with status = 0
[2018-04-04 17:49:21] [debug] ( javajni.c:1013) [ 864] Java Worker thread finished org/apache/catalina/startup/Bootstrap:main with status = 0
[2018-04-04 17:49:21] [debug] ( prunsrv.c:1577) [ 2724] Worker finished.
[2018-04-04 17:49:21] [debug] ( prunsrv.c:1586) [ 2724] Waiting for ShutdownEvent
[2018-04-04 17:49:21] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 60000, dwServiceSpecificExitCode = 0
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1032) [ 2460] Waiting for Java JNI stop worker to finish...
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1034) [ 2460] Java JNI stop worker finished.
[2018-04-04 17:49:22] [debug] ( prunsrv.c:885 ) [ 2460] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 300000, dwServiceSpecificExitCode = 0
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1141) [ 2460] Waiting for worker to die naturally...
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1152) [ 2460] Worker finished gracefully in 0 ms.
[2018-04-04 17:49:22] [info] ( prunsrv.c:1162) [ 2460] Service stop thread completed.
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1589) [ 2724] ShutdownEvent signaled
[2018-04-04 17:49:22] [debug] ( prunsrv.c:1594) [ 2724] Waiting 1 minute for all threads to exit
[2018-04-04 17:49:22] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 3, dwWin32ExitCode = 0, dwWaitHint = 60000, dwServiceSpecificExitCode = 0
[2018-04-04 17:50:22] [debug] ( prunsrv.c:1607) [ 2724] JVM destroyed.
[2018-04-04 17:50:22] [debug] ( prunsrv.c:885 ) [ 2724] reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode = 0, dwWaitHint = 0, dwServiceSpecificExitCode = 0
[2018-04-04 17:50:22] [info] ( prunsrv.c:1645) [ 3836] Run service finished.
[2018-04-04 17:50:22] [info] ( prunsrv.c:1814) [ 3836] Commons Daemon procrun finished
这里是尝试停止tomcat服务后的日志,特别有意思从:17:49:22到:17:50:22
最佳答案
关于Tomcat 服务停止在 Windows 上从 32 位升级到 64 位花费的时间太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49627081/