tomcat停止进程无法终结

tomcat停止进程无法终结

请教各位大虾:
系统环境Ras3+jdk1.5.06+tomcat5.515
使用 :

[Copy to clipboard] [ - ]
CODE:
../tomcat/bin/startup.sh          //start
../tomcat/bin/shutdown.sh      //stop


可以正常启动tomcat,服务运行也正常
但是有时候无法停止tomcat ,一般需要执行二次
../tomcat/bin/shutdown.sh
才能停止,有时候很顺利的就可以停止
无法停止时,提示如下:

[Copy to clipboard] [ - ]
CODE:
# ./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/jdk
Mar 17, 2006 4:13:15 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        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:507)
        at java.net.Socket.connect(Socket.java:457)
        at java.net.Socket.<init>(Socket.java:365)
        at java.net.Socket.<init>(Socket.java:178)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:394)
        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:585)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
[root@scs bin]# ps aux |grep tomcat
root      8224 31.4 16.5 287896 31352 pts/0  S    04:13   0:08 /usr/java/jdk/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath :/usr/local/tomcat/bin/boots
root      8282  0.0  0.3  4752  672 pts/0    S    04:13   0:00 grep tomcat

补充一点
../tomcat/logs/catalina.out

[Copy to clipboard] [ - ]
CODE:
Mar 17, 2006 5:09:52 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:09:52 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2504 ms
Mar 17, 2006 5:09:52 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 17, 2006 5:09:52 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Mar 17, 2006 5:09:52 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 17, 2006 5:09:55 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:09:56 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 17, 2006 5:09:56 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/245  config=null
Mar 17, 2006 5:09:56 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 17, 2006 5:09:57 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4915 ms
Mar 17, 2006 5:10:05 AM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:10:06 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Mar 17, 2006 5:10:06 AM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:10:06 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime
Mar 17, 2006 5:10:17 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/suncs/jdk1.5.0_06/jre/lib/i386/client:/home/suncs/jdk1.5.0_06/jre/lib/i386:/home/suncs/jdk1.5.0_06/jre/../lib/i386
Mar 17, 2006 5:10:18 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:10:18 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3961 ms
Mar 17, 2006 5:10:18 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 17, 2006 5:10:18 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Mar 17, 2006 5:10:18 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 17, 2006 5:10:22 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 17, 2006 5:10:23 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 17, 2006 5:10:23 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/411  config=null
Mar 17, 2006 5:10:23 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 17, 2006 5:10:23 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5534 ms

这个好像是tomcat bug啊!
我都是kill掉


QUOTE:
原帖由 mageguoshi 于 2006-3-19 01:01 发表
这个好像是tomcat bug啊!
我都是kill掉

听老兄说的意思,这是正常的?


QUOTE:
原帖由 qmailer 于 2006-3-18 23:54 发表
请教各位大虾:
系统环境Ras3+jdk1.5.06+tomcat5.515
使用 :

[Copy to clipboard] [ - ]
CODE:
../tomcat/bin/startup.sh          //start
../tomcat/bin/shutdown.sh      //stop


可以正常启动tomcat,服务运行也 ...

请教各位,这究竟是tomcat的问题,还是jdk的问题啊?
是tomcat的bug, 以前java版的perryhg斑竹也提过,最终解决办法是使用manual中提到jsvc办法解决。

我用tomcat4没遇到此问题,但用tomcat5.5都是如此, 为图方便每次都是用kill杀的

[Copy to clipboard] [ - ]
CODE:
#!/bin/bash

if [ "$CATALINA_HOME" = "" ]; then
. ~tomcat/.bashrc.tomcat.env
#TOMCAT_GCFILE=/var/log/tomcat55.gc
fi

pid=`ps -ef|grep "java"|grep "tomcat"|grep "$TOMCAT_GCFILE"|grep -v "grep"|awk '{print $2}'`
if [ "$pid" = "" ] ; then
  echo "no tomcat pid alive"
else
  echo "kill pid $pid now"
  kill $pid
fi

tomcat5.5.12 / j2sdk1.4.2 / rh8.0 (linux2.4.1

感谢回复

有两点不明白:
1.

QUOTE:
最终解决办法是使用manual中提到jsvc办法解决。


这个办法就是使用,../tomcat/bin/jsvc.tar.gz  吗?

2.

QUOTE:
CODE:[Copy to clipboard]#!/bin/bash

if [ "$CATALINA_HOME" = "" ]; then
. ~tomcat/.bashrc.tomcat.env
#TOMCAT_GCFILE=/var/log/tomcat55.gc
fi

pid=`ps -ef|grep "java"|grep "tomcat"|grep "$TOMCAT_GCFILE"|grep -v "grep"|awk '{print $2}'`
if [ "$pid" = "" ] ; then
  echo "no tomcat pid alive"
else
  echo "kill pid $pid now"
  kill $pid
fi

这段脚本是什么文件?
现在这问题还是要通过手工来删除么?!
这个问题可能和TOMCAT关闭时要和本地的8005端口通讯,如果防火墙设置上,好比IPTABLES上对LO有限制的话,就会造成和8005无法通讯,造成无法关闭.可能是这个原因,尝试检查下防火墙设置吧,或者停止防火墙服务检查下.
N年前的贴也回