Cannot stop Jaspersoft Server with shutdown.bat

book

Article ID: 197432

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

Error message when trying to stop Tomcat running the command shutdown.bat:

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>shutdown.bat
Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_231"
Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomcat-juli.jar"
17-Aug-2020 06:31:24.516 SEVERE [main] org.apache.catalina.startup.Catalina.stopServer Could not contact [localhost:[8005]]. Tomcat may not be running.
17-Aug-2020 06:31:24.516 SEVERE [main] org.apache.catalina.startup.Catalina.stopServer Catalina.stop:
 java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
        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.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:606)
        at java.net.Socket.connect(Socket.java:555)
        at java.net.Socket.<init>(Socket.java:451)
        at java.net.Socket.<init>(Socket.java:228)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:497)
        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.stopServer(Bootstrap.java:406)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

Cause

Tomcat has a shutdown port. The default port is 8005. When you have this issue, somehow, the port is not listening, or Tomcat does not have access to it (firewall is blocking it, for example).

Environment

Release : 15.8.1

Component : CA PPM APPLICATION

Resolution

Before running the shutdown.bat command, please, run the command below:

netstat -an | findstr 8005

Make sure the port 8005 and up and listening.

If not, consider talking to your operating system administrator to double-check the server configuration.

It is important to make sure no other applications are using this port (8005).

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>netstat -an | findstr 8005
  TCP    127.0.0.1:8005         0.0.0.0:0              LISTENING

If port 8005 is listening, shutdown.bat works without presenting error messages:

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>shutdown.bat
Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_231"
Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomcat-juli.jar"

Additional Information

Starting, Stopping, and Restarting Tomcat

Why have a shutdown port in Tomcat?

Why Tomcat will not bind to shutdown port (8005)?