运行shutdown.sh和./catalina.sh stop均报错:
[root@localhost bin]# sh shutdown.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr/java/jdk1.6.0_17 Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar Jul 17, 2015 9:47:54 AM org.apache.catalina.startup.Catalina stopServer SEVERE: Could not contact localhost:8005. Tomcat may not be running. Jul 17, 2015 9:47:54 AM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at java.net.Socket.connect(Socket.java:475) at java.net.Socket.<init>(Socket.java:372) at java.net.Socket.<init>(Socket.java:186) at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)
Could not contact localhost:8005 //这句好像挺重要
[root@localhost bin]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:40832 0.0.0.0:* LISTEN 3016/rpc.statd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2879/rpcbind tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 3598/dnsmasq tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 3245/vsftpd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3047/cupsd tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3736/sshd tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 4049/sshd tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 3224/sshd tcp 0 0 :::47458 :::* LISTEN 3016/rpc.statd tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 3601/java tcp 0 0 :::8009 :::* LISTEN 3601/java tcp 0 0 :::3306 :::* LISTEN 3433/mysqld tcp 0 0 :::111 :::* LISTEN 2879/rpcbind tcp 0 0 :::81 :::* LISTEN 3601/java tcp 0 0 :::23 :::* LISTEN 3233/xinetd tcp 0 0 ::1:631 :::* LISTEN 3047/cupsd tcp 0 0 ::1:6010 :::* LISTEN 3736/sshd tcp 0 0 ::1:6011 :::* LISTEN 4049/sshd tcp 0 0 :::3389 :::* LISTEN 3224/sshd
因为你已经shutdown过一次了,但是并没有成功结束掉java进程,所以8005端口已经被shutdown了,无法再次通过8005端口停掉服务。
只有手工kill掉java进程了。
想不用每次都这么麻烦的话,看我的博客吧: http://my.oschina.net/abcfy2/blog/192203
这个问题解决了吗,我也遇到这个问题了回复 @一把刀:手工杀掉tomcat的进程,然后再重启。如果8005端口无法启动,肯定会有日志重启之后,依然这样报错啊,而且8005还是没起来,,,版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。