On Fri, Feb 14, 2014 at 1:44 PM, Pooja Swamy <poojasw...@gmail.com> wrote:

> I am unable to shutdown my tomcat gracefully. Everytime I try to shutdown
> tomcat, this is the error I get.
>
> test@17.198.48.77:/Users/test/software/tomcat/bin>./startup.sh

Using CATALINA_BASE:   /Users/test/software/tomcat
> Using CATALINA_HOME:   /Users/test/software/tomcat
> Using CATALINA_TMPDIR: /Users/test/software/tomcat/temp
> Using JRE_HOME:
>  /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
> Using CLASSPATH:
>
> /Users/test/software/tomcat/bin/bootstrap.jar:/Users/test/software/tomcat/bin/tomcat-juli.jar
>

OK, you started tomcat successfully. Now, it would be good idea to check
what ports tomcat listens to, e.g.

netstat -vatpn | grep LISTEN    (on Linux)
lsof -i TCP | grep LISTEN         (on Mac)

- Standard configuration would have the following ports open:
8005 - shutdown port
8009 - AJP port
8080 - HTTP port (app-serving)
8443 - HTTPS port (app-serving) - optional

What does your /Users/test/software/tomcat/conf/server.xml say?



> test@17.198.48.77:/Users/test/software/tomcat/bin>./shutdown.sh
> Using CATALINA_BASE:   /Users/test/software/tomcat
> Using CATALINA_HOME:   /Users/test/software/tomcat
> Using CATALINA_TMPDIR: /Users/test/software/tomcat/temp
> Using JRE_HOME:
>  /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
> Using CLASSPATH:
>
> /Users/test/software/tomcat/bin/bootstrap.jar:/Users/test/software/tomcat/bin/tomcat-juli.jar
> Feb 14, 2014 6:37:52 PM org.apache.catalina.startup.Catalina stopServer
> SEVERE: Catalina.stop:
> java.net.ConnectException: Connection refused
>

There is a problem shutdown - you are not able to connect to the shutdown
port for some reason.

at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:431)
> at java.net.Socket.connect(Socket.java:527)
> at java.net.Socket.connect(Socket.java:476)
> at java.net.Socket.<init>(Socket.java:373)
> at java.net.Socket.<init>(Socket.java:187)
> 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)
>
>
> I have also tried killing, restarting, and ./shutdown.sh, installing tomcat
> again, changing port number. Nothing seems to be helping. Please advise.
>


What does your server.xml configure as shutdown port?
What does the log file say about shutdown port?
After restarting - what ports are bound by the tomcat process?


Also, when troubleshooting  - I like to start tomcat with "./catalina.sh
run" instead of "./catalina.sh start" or "./startup.sh".
I do that when I am troubleshooting, as all the logs are directly in the
STDOUT (console), and it is easy to CTRL+C and stop the process, and
UP-ARROW-ENTER to restart it ...

It is probably misconfigued shutdown port (i.e. -1 or 0)


Try to provide additional information when stating the problem:
- tomcat version
- jdk version
- operating system


Good luck!

Reply via email to