• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.net.ConnectException: Connection refused  RSS feed

preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

Kees Jan Koster
JavaMonitor Support
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!