Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had manually installed tomcat on Ubuntu 12.04 it worked fine for couple of time but now its throwing this error

alpha@TM:~/apache-tomcat-6.0.35/bin$ st
Using CATALINA_BASE:   /home/alpha/apache-tomcat-6.0.35
Using CATALINA_HOME:   /home/alpha/apache-tomcat-6.0.35
Using CATALINA_TMPDIR: /home/alpha/apache-tomcat-6.0.35/temp
Using JRE_HOME:        /usr/lib/jvm/java-6-openjdk-i386
Using CLASSPATH:       /home/alpha/apache-tomcat-6.0.35/bin/bootstrap.jar
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ]  { -help | start | stop }
16 Jul, 2012 6:21:06 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: Connection refused
    at Method)
    at org.apache.catalina.startup.Catalina.stopServer(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.apache.catalina.startup.Bootstrap.stopServer(
    at org.apache.catalina.startup.Bootstrap.main(

I Googled and searched on StackOverflow a lot, but couldn't fined correct solution to this problem. I have tried changing tomcats listening port and shutdown port in conf/server.xml , but it still didn't. Any help will be appreciated.

share|improve this question

migrated from Jul 19 '12 at 1:51

This question came from our site for professional and enthusiast programmers.

You should check your processes (ps -aux | grep tomcat-6.0.35) and kill your tomcat if it's still running. – mihaisimi Jul 16 '12 at 14:05
do you start it as root? if not, then used ports must be > 1024, as ports < 1024, called "priviledged ports", can only be used by the root user. – Arcadien Jul 16 '12 at 14:06
Hey arcadien, thanks a lot.. that solved my problem.. – abhimanyu5555 Jul 16 '12 at 15:09

From what I can see, tomcat is not starting at all. It seems like there is an error in your script. In fact, you can see that, before throwing the exception, it writes :

usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ]  { -help | start | stop }

This means that something is wrong with the command line your script is using to start (or stop) tomcat.

Then, there is the exception. That exception is not the Tomcat server having problems. It is actually the "stop" command not managing to connect to any Tomcat to stop, because Tomcat is not started given the previous error.

When Tomcat starts correctly, it listens on port 8080 (or whatever you configured it) to serve HTTP requests, but also listens on another port (usually 8005, bound only to localhost). This port is the "shutdown port". When you want to shutdown Tomcat, the script starts another small java program, that connects to port 8005 and issues the shutdown command to the running Tomcat.

This is the "connection refused" exception you see, there is no Tomcat to connect to, because Tomcat is not running.

In fact, you usually see the same exception if you issue a tomcat stop when you never started Tomcat.

You should inspect your script, find where it execute the start command, see what it looks like (replace it with an echo, see what it prints), and check if it is coherent with the usage instructions. It should look something like :

java -cp [some .jar files here] org.apache.catalina.startup.Catalina -config [path to config files, but it's optional] start
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.