Bug 49195 - Using -1 as shutdown port with Windows service works, but prints error message
Summary: Using -1 as shutdown port with Windows service works, but prints error message
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.26
Hardware: PC Windows XP
: P2 minor (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2010-04-27 10:22 UTC by Konstantin Kolinko
Modified: 2010-10-04 17:04 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2010-04-27 10:22:54 UTC
1. Install Tomcat as a service on Windows
2. Specify <Server port="-1" in server.xml
3. Start the service, and then stop the service.
4. The following is printed in the catalina.2010-04-27.log:

27.04.2010 17:49:13 org.apache.catalina.startup.Catalina stopServer
SEVERE: No shutdown port configured. Shut down server through OS signal. Server not shut down.

It is just a message. Tomcat stops regardless of it:
After printing the message Catalina#stopServer() performs System.exit(1) which results in Tomcat shutdown.

I think that when service launcher stops Tomcat, Catalina#server is not null. That can be used to differentiate the two use cases.

There could be improvements on how to stop Tomcat. E.g., to call Catalina.stop(). If that is the case, it would be better to use wait(10000) instead of sleep(10000) in StandardServer.await(), so that it could be woken by a notifyAll() call, or use interrupt() call to wake it up (if we know the thread). System.exit(0) would work regardless of all that.

I suppose that jsvc may show the same behaviour, but I have not tried.
Comment 1 Mark Thomas 2010-10-04 17:04:50 UTC
This has been fixed in 6.0.x and will be included in 6.0.30 onwards.