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

I have this problem with stopping and starting tomcat6 (package from the repos). I've seen with several CentOS 6 and RHEL 6 boxes.

The symptoms are that when I want to restart or stop tomcat6 it just fails. This seems to be only happening after it has been running for a while. I have a fresh CentOS 6 install and was able to restart it, but not anymore.

This is what i see:

 # service tomcat6 restart
 Stopping tomcat6:                                          [FAILED]
 Starting tomcat6:                                          [FAILED]

When I try through /usr/sbin/tomcat6:

# /usr/sbin/tomcat6 stop
/usr/sbin/tomcat6: line 60: /logs/catalina.out: No such file or directory

And output from /var/log/tomcat6/catalina.out:

Oct 22, 2012 4:53:31 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
    at java.net.Socket.connect(Socket.java:546)
    at java.net.Socket.connect(Socket.java:495)
    at java.net.Socket.<init>(Socket.java:392)
    at java.net.Socket.<init>(Socket.java:206)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:424)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

I've searched the net and I can see that I am not alone, but haven't found a proper solution, hence my question.

BTW: I'm not too familiar with tomcat. Oh and: first post! So be nice ;)

share|improve this question
What does ps ax | grep tomcat6 tells you ? – David Levesque Oct 23 '12 at 0:04
15775 ? Sl 0:27 /usr/lib/jvm/java/bin/java -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -classpath :/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar:/us‌​r/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat6/temp -Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start – aairey Oct 23 '12 at 6:10
After a reboot it seems to be working fine. But I suspect it to return. – aairey Oct 23 '12 at 6:14
If the output above was obtained before the reboot, it means that an instance of Tomcat was still running in the background. If it happens again, try killing the process, e.g. kill 15775. – David Levesque Oct 23 '12 at 14:10

2 Answers

I've faced the same problem. For me, It happened due to file permission/owner problem. When the init.d or /usr/sbin/tomcat6 script is unable to read the /etc/tomcat6/tomcat6.conf file, then value of ${CATALINA_BASE} becomes empty. So ${CATALINA_BASE}/logs/catalina.out in line 60 becomes /logs/catalina.out.

share|improve this answer

I am running Tomcat7 on CentOS; previously I was running Tomcat6.

In order to restart Tomcat, I always just go into the bin directory of my Tomcat installation and run shutdown.sh, then startup.sh You should be able to do it this way as a fallback method

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.