We're currently in a situation where a Tomcat service is being brought offline by a batch script each night (or at the presence of a war archive, at least) in a Windows clustered environment.
The problem is that when Windows shuts down the tomcat service, it does not do so gracefully. This could mean (and has multiple times) that a service is listening and being used during the shutdown, alas terminating abnormally - or as in our case, we want to deploy a new webapp with the same name, but a jar file is being locked due to being in use.
Does anyone know of a nice way to gracefully shutdown the Tomcat service in this kind of solution? We're running Tomcat 5.5.
Have you looked at Windows service HOW-TO? From looking at that it seems possible to change what happens at service start and stop after it is installed.