You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Irek Matysiewicz <ir...@uhc.com.pl> on 2007/09/20 17:18:59 UTC

Can't stop Tomcat

Hello everyone. I have the following, serious problem with Tomcat:

We're using Tomcat 5.5.23. We run Tomcat as system service. In Linux it 
works well, but in Window Vista almost always (and sometimes in Windows 
XP) we have one of the following exceptions during Tomcat shutdown:

2007-08-13 20:20:43,972 [Thread-4] ERROR 
org.apache.catalina.startup.Catalina - Catalina.stop:
java.net.ConnectException: Connection refused: connect
    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:519)
    at java.net.Socket.connect(Socket.java:469)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:179)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
    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:344)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)

OR

2007-09-20 16:04:32,493 [Thread-1] WARN  
org.apache.catalina.connector.MapperListener - Error unregistering 
MBeanServerDelegate
java.lang.NullPointerException
    at 
org.apache.catalina.connector.MapperListener.destroy(MapperListener.java:162)
    at org.apache.catalina.connector.Connector.stop(Connector.java:1138)
    at 
org.apache.catalina.core.StandardService.stop(StandardService.java:519)
    at org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
    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.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


Tomcat is stopped, but the result is the following exception during next 
startups of Tomcat:

2007-09-20 16:06:20,947 [Thread-1] ERROR 
org.apache.coyote.http11.Http11BaseProtocol - Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8081
    at 
org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:298)
    at 
org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java:139)
    at 
org.apache.catalina.connector.Connector.initialize(Connector.java:1017)
    at 
org.apache.catalina.core.StandardService.initialize(StandardService.java:578)
    at 
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:782)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:504)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

And then Tomcat is useless unless we change the port number or reboot 
the computer. When I type 'netstat -a -o -b' in the console, I get 
information that  process named 'system' still owns this port.
What is funnier it has the same PID as the PID of already killed Tomcat. 
When I try to kill this process manually I get message that this process 
doesn't exist. Task Manager also doesn't show this process.

We tried two solutions:

- Calling: taskkill /FI "SERVICES eq QMATomcat" /F /T. Always works, but 
this doesn't give Tomcat any chance to exit normally, so results in 
future could be unpredictable.

- Calling shutdown.bat in loop until it returns 0. On some computers 
works, on some not (then we get the second exception - Error 
unregistering MBeanServerDelegate).


If You know what could be wrong, please help us.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org