title: Apache Tomcat Shutdown :java.net.ConnectException: Connection refused
body: <p>I installed tomcat 7 on centos 5.8. 
  Then I executed ./startup.sh and ./shutdown.sh, it worked well.</p>
  
  <p>Then I put a something.war under the  webapps/. it worked well too.
  But when i shutdown the tomcat, it doesn't work and throws an exception:</p>
  
  <pre><code>java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
          at java.net.Socket.connect(Socket.java:529)
          at java.net.Socket.connect(Socket.java:478)
          at java.net.Socket.&lt;init&gt;(Socket.java:375)
          at java.net.Socket.&lt;init&gt;(Socket.java:189)
          at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:499)
          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:371)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)
  </code></pre>
  
  <p>And i'm sure:</p>
  
  <ol>
  <li><p>The tomcat is running and works well before i execute ./shutdown.sh</p></li>
  <li><p>The process of the tomcat is still alive, but it isn't listening the port 8080, after i execute ./shutdown.sh</p></li>
  </ol>