title: Could not contact localhost:8005. Tomcat may not be running error while shutdown tomcat
body: <p>Hi I am trying to shutdown and startup tomcat server. But i am getting below error while running shutdown.sh. Please check below error and suggest me to complete.</p>
  
  <p>Error:</p>
  
  <pre><code>Using CATALINA_BASE:   /opt/tomcat8
  Using CATALINA_HOME:   /opt/tomcat8
  Using CATALINA_TMPDIR: /opt/tomcat8/temp
  Using JRE_HOME:        /usr/java/jdk1.8.0_74
  Using CLASSPATH:       /opt/tomcat8/bin/bootstrap.jar:/opt/tomcat8/bin/tomcat-ju                                                                                        li.jar
  Jul 24, 2017 11:01:47 PM org.apache.catalina.startup.Catalina stopServer
  SEVERE: Could not contact localhost:8005. Tomcat may not be running.
  Jul 24, 2017 11:01:48 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.ja                                                                                        va:350)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket                                                                                        Impl.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)
  </code></pre>
  
  <p>Also please find log:</p>
  
  <pre><code>24-Jul-2017 23:48:28.884 SEVERE [main] org.apache.catalina.core.StandardServer.await StandardServer.await: create[localhost:8005]: 
   java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
      at java.net.ServerSocket.bind(ServerSocket.java:375)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:237)
      at org.apache.catalina.core.StandardServer.await(StandardServer.java:420)
      at org.apache.catalina.startup.Catalina.await(Catalina.java:717)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:663)
      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:498)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
  
  24-Jul-2017 23:48:28.884 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8082"]
  24-Jul-2017 23:48:28.884 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
  24-Jul-2017 23:48:28.884 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
  24-Jul-2017 23:48:28.988 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8082"]
  24-Jul-2017 23:48:28.990 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8082"]
  24-Jul-2017 23:48:28.992 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
  24-Jul-2017 23:48:28.992 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
  </code></pre>