On 22.07.2010 17:02, John A Parker wrote:
Using apache-tomcat-6.0.28...

We are encountering issue with "catalina.sh stop"s IF we use a variable to set 
the SHUTDOWN port.

e.g.:
CATALINA_OPTS = "...-Dco.shutdown.port=8104 ..."
server.xml =    "...
                  <!-
                  <Server port="8104" shutdown="SHUTDOWN">
                  -->
                  <Server port="${co.shutdown.port}" shutdown="SHUTDOWN">
                  ..."


After startup we see...

...
java     24389 tcowner   42u  IPv6 8406404       TCP localhost.localdomain:8104 
(LISTEN)


But on shutdown we get...

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:529)
         at java.net.Socket.connect(Socket.java:478)
         at java.net.Socket.<init>(Socket.java:375)
         at java.net.Socket.<init>(Socket.java:189)
         at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
         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:338)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Tomcat did not stop in time. PID file was not removed.


IF however I swap the server.xml SHUTDOWN port lines shown above then the 
catalina.sh stop works as it should.


Any ideas on why the dynamic port definition works on startup but not on 
shutdown?

CATALINA_OPTS is only used during startup. If you want to add parameters for startup and shutdown, use JAVA_OPTS. See also the comments at the beginning of catalina.(sh|bat).

Regards,

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to