tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Kaldenbach <>
Subject Stopping Tomcat in same JVM stops everything
Date Tue, 13 Mar 2001 12:15:40 GMT
Tomcat 3.2.1 as Thread in same JVM: how to stop/restart properly?
(Windows NT, as standalone-HTTP-server)

I'd like to run Tomcat embedded as Thread in an own application.
It should be possible to restart Tomcat without restarting the
whole application.

But stopping Tomcat by calling the main(...) method of
org.apache.tomcat.startup.Tomcat will finally send a
signal "15" to the Ajp12ConnectionHandler which leads
to a System.exit(0). Unfortunately this also stops any
other running threads, including the invoking one...

Therefore I think the following code should be improved:

(from org.apache.tomcat.service.connector.Ajp12ConnectionHandler:)

if ( (signal== 15) && isSameAddress(serverAddr, clientAddr) ) {
  // Shutdown - probably apache was stoped with apachectl stop
  // same behavior as in past, because it seems that
  // stopping everything doesn't work - need to figure
  // out what happens with the threads ( XXX )

In addition I think, there should be a "restart" option.

Has anyone got a good solution for stopping and restarting
a Tomcat instance within the same JVM?



| Matthias Kaldenbach    | call:+49(0)631/60848               |
| Tannenstrasse 14       |  |
| D-67655 Kaiserslautern | |

To unsubscribe, e-mail:
For additional commands, email:

View raw message