wood burning stoves 2.0*
The moose likes Tomcat and the fly likes java.net.ConnectException: Connection refused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "java.net.ConnectException: Connection refused" Watch "java.net.ConnectException: Connection refused" New topic
Author

java.net.ConnectException: Connection refused

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,

I am running tomcat in trixbox (cent os package).when I start tomcat,it starts fine and working .But when i stop tomcat,
the following error displayed and i am unable to stop the tomcat.

Mar 22, 2009 7:11:38 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.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:180)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
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:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)

Any help to solve this problem would be appreciated.

Thanks
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear preethi,

This is most likely a configuration issue caused by the repackaging done for the RPM package. I really dislike yum/rpm/apt packages for Tomcat. The mostly cause more problems than they solve and to top it off they stick you with old versions of Tomcat.

Best install a real Tomcat from Apache.org and these problems tend to go away.

If you want to debug and solve this problem yourself, check out the configured stop port (default 8005) in Tomcat's server.xml. Look for a line like: <Server port="8005" shutdown="SHUTDOWN">. To check if Tomcat is listening on that port, use netstat as discussed here: http://java-monitor.com/forum/showthread.php?t=22

Kees Jan
http://java-monitor.com/forum/


Java-monitor, JVM monitoring made easy <- right here on Java Ranch
 
 
subject: java.net.ConnectException: Connection refused