Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185134 - www-servers/tomcat - cannot stop via initscript
Summary: www-servers/tomcat - cannot stop via initscript
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: William L. Thomson Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-12 23:40 UTC by Nicolas Laplante
Modified: 2007-07-15 17:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Laplante 2007-07-12 23:40:42 UTC
Whenever I try to stop Tomcat, the command returns with an error:

valhalla tomcat-6 # /etc/init.d/tomcat-6 stop
 * Stopping Tomcat ...                 [ !! ]

After this command has been issued, the java process running the server is still alive, and I get this in /var/log/tomcat-6/catalina.out:

Jul 12, 2007 7:34:17 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jul 12, 2007 7:37:27 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
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:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:208)
        at org.apache.jk.common.ChannelSocket.unLockSocket(Unknown Source)
        at org.apache.jk.common.ChannelSocket.pause(Unknown Source)
        at org.apache.jk.server.JkMain.pause(Unknown Source)
        at org.apache.jk.server.JkCoyoteHandler.pause(Unknown Source)
        at org.apache.catalina.connector.Connector.pause(Unknown Source)
        at org.apache.catalina.core.StandardService.stop(Unknown Source)
        at org.apache.catalina.core.StandardServer.stop(Unknown Source)
        at org.apache.catalina.startup.Catalina.stop(Unknown Source)
        at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Unknown Source)
Jul 12, 2007 7:37:28 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jul 12, 2007 7:37:29 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080


It seems that "pause" is taking very long time (3 minutes in this case), so that's why the init script fails.


Reproducible: Always

Steps to Reproduce:
1. Start Tomcat via init script
2. Use tomcat
3. Stop tomcat via init script (/etc/init.d/tomcat-6 stop)

Actual Results:  
The "stop" command fails and the error message stated in the bug description is logged in catalina.out.

Expected Results:  
The tomcat process ends without errors

Happened too with tomcat-5.5
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-07-13 14:05:25 UTC
This is a local problem specific to your machine. Not a generic one effecting all that install Tomcat via ebuild on Gentoo.

> Jul 12, 2007 7:37:27 PM org.apache.catalina.connector.Connector pause
> SEVERE: Protocol handler pause failed
> java.net.ConnectException: Connection timed out

Tomcat makes a network request to shut itself down. If that network request fails for what ever reason. Tomcat won't receive the request, and won't shut down. As you are seeing above, and the delays you are experiencing are due to network timeouts.

This should be all taking place via localhost 127.0.0.1, so possibly your /etc/hosts file is messed up. And/or you have local DNS resolution issues or etc. Something on your machine is not allowing Tomcat to talk to itself via tcp/ip. Thus no shut down and delays as the network request times out.

I will leave this open for a bit for you to work out the local problem and comment if you want to. But likely will be closing this as invalid at some point.
Comment 2 Nicolas Laplante 2007-07-13 22:45:21 UTC
You were right. I opened port 8009 in iptable's firewall to make it work. Strange enough, I did configure the firewall to accept all requests originating from localhost, but it didn't work. I had to open port 8009 to the whole subnet (192.168.0.0/24).

Thanks for the help!
Comment 3 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-07-15 17:01:42 UTC
No problem, glad you got it worked out :)