A solution adapted to Java, is the Java Service Wrapper ( http://wrapper.tanukisoftware.org/doc/english/introduction.html ) (opensource). The setup is very simple with one configuration file and your Java service can be notified when the service is stopped.
If you log in and log out from a machine and a java service is running then the service may be stopped. The fix is to use Java 1.3.1 or higher and start the process with the JVM switch -Xrs (Reduce Signals Xtended-switch) to stop the Windows signal from killing the JVM.
For BEA JRockit, it's the -Xnohup
http://www.techeez.com/windows_tips/service_under_nt.htm
SVRANY is used to run any EXE as a windows service. In our situation, SVRANY will run the specified JAVA.EXE with our class a parameter. But this solution presents many problems. For exemple, if you kill the SVRANY.EXE process (stop the service) then the JAVA.EXE is not killed, you need to do it manually.
Written and compiled by Réal Gagnon ©1998-2007
[ home ]