title: Tomcat : java.net.ConnectException: Connection refused
body: <p>I am trying to shutdown and start my tomcat after i uploaded new war file. but i am getting Connection refused error while shutdown the tomcat instance. the error is below ,</p>
  
  <pre><code>Oct 31, 2015 2:55:44 AM org.apache.catalina.startup.Catalina stopServer
  SEVERE: Could not contact localhost:8005. Tomcat may not be running.
  Oct 31, 2015 2:55:44 AM 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:350)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
          at java.net.Socket.connect(Socket.java:589)
          at java.net.Socket.connect(Socket.java:538)
          at java.net.Socket.&lt;init&gt;(Socket.java:434)
          at java.net.Socket.&lt;init&gt;(Socket.java:211)
          at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)
  
  Tomcat stopped
  </code></pre>
  
  <p>Even i killed running java id using kill -9 PID but still i am getting same error and i can not start my application.</p>
  
  <p>How to fix this and shutdown my tomcat without bug ?</p>