I installed tomcat 7 on centos 5.8. Then I executed ./startup.sh and ./shutdown.sh, it worked well.
Then I put a something.war under the webapps/. it worked well too. But when i shutdown the tomcat, it doesn't work and throws an exception:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:499)
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:371)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)
And i'm sure:
The tomcat is running and works well before i execute ./shutdown.sh
The process of the tomcat is still alive, but it isn't listening the port 8080, after i execute ./shutdown.sh
Some possibilities come to my mind:
kill -3 pid
) on the running tomcat process, the output will (most likely) end up in catalina.out ps
outputserver.xml
) - that's what shutdown.sh is contacting in order to instruct tomcat to shut down