简体   繁体   English

Tomcat没有关闭

[英]Tomcat is not shutting down

I am unable to shutdown tomcat. 我无法关闭tomcat。 When I do ./shutdown.sh, I don't see any error, but the process still seems to be running. 当我执行./shutdown.sh时,看不到任何错误,但是该进程似乎仍在运行。 When I kill the process (kill -9), the process gets killed. 当我杀死进程(kill -9)时,进程被杀死。 After this, if I do a startup, and shutdown again, I see the same problem. 此后,如果我启动并再次关闭,则会看到相同的问题。 How do I gracefully shut it down? 我如何优雅地关闭它? Why is this happening in the first place? 为什么首先发生这种情况? Please help me. 请帮我。

devServer:bin dev$ ps -ef|grep tomcat
  501 34933     1   0 11:24PM test    0:02.02 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
  501 34982 33786   0 11:45PM test    0:00.00 grep tomcat
devServer:bin dev$ ./shutdown.sh
Using CATALINA_BASE:   /Users/dev/admin/runtime
Using CATALINA_HOME:   /Users/dev/admin/runtime
Using CATALINA_TMPDIR: /Users/dev/admin/runtime/temp
Using JRE_HOME:        /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH:       /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar
devServer:bin dev$ ps -ef|grep tomcat
  501 34933     1   0 11:24PM test    0:02.03 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
  501 34992 33786   0 11:45PM test    0:00.00 grep tomcat
devServer:bin dev$ 

Also, I see my catalina.out is rather too short. 另外,我看到我的catalina.out太短了。 There is no port number info getting written to it at all. 根本没有端口号信息写入其中。 This is all I see everytime I startup. 这就是我每次启动时所看到的。

Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

Here is my log file - 这是我的日志文件-

devServer:logs dev$ cat catalina.2014-02-15.log 
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

Something seems to be terribly messed up. 似乎有些混乱。 I can't understand what. 我不明白 Please advise. 请指教。 I am running tomcat 7.0.50 on Mac OS. 我在Mac OS上运行tomcat 7.0.50。

Judging by the logs, it is evident that tomcat is not starting up at all as it should be. 从日志来看,很明显tomcat根本没有启动。 I can advise a couple of other tests as well like to 我可以建议其他一些测试以及

  1. Verify whether or not the ports are getting bound by the tomcat service or not. 验证端口是否受tomcat服务绑定。 You can do this by issueing the command netstat -tuplen on the terminal and check to see if port 8080 is getting bound by the tomcat instance or not. 您可以通过在终端上netstat -tuplen命令netstat -tuplen来执行此操作,并检查端口8080是否已被tomcat实例绑定。
  2. Check to see if you can ping the instance. 检查是否可以ping通实例。 Try to ping the tomcat instance from a local machine. 尝试从本地计算机ping tomcat实例。 Then try to ping the public ip of the server to verify whether that server is responding correctly or not 然后尝试ping服务器的公共IP,以验证该服务器是否正确响应
  3. Verify that you have, infact, the complete tomcat template as is used by your other servers. 实际上,请确认您具有其他服务器使用的完整的tomcat模板。 Verify the tomcat installtion folder and compare it with the other tomcat templates as used in rest of your servers. 验证tomcat安装文件夹,并将其与其余服务器中使用的其他tomcat模板进行比较。 Make sure all folders are there, all configuration (default tomcat config) files are present. 确保所有文件夹都在其中,所有配置(默认为tomcat config)文件都存在。
  4. (Just a hunch) Verify read/write/execute privileges as well (仅凭直觉)还要验证读/写/执行权限
  5. Remove your application, shutdown tomcat, empty the logs, and then restart tomcat and re-deploy your application and then view the logs to see if you get some error 删除您的应用程序,关闭tomcat,清空日志,然后重新启动tomcat并重新部署您的应用程序,然后查看日志以查看是否出现错误

Point 3 seems more likely that you have an incomplete tomcat instance, so I advise you to make a copy of the tomcat instance used in any other server and use it in this server to make sure that the server environment is infact how it should be 第3点似乎更有可能是您的tomcat实例不完整,因此我建议您复制任何其他服务器中使用的tomcat实例,并在该服务器中使用它,以确保服务器环境保持应有的状态

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM