|
From: Leif M. <le...@ta...> - 2003-10-21 16:55:25
|
Ori, This is a new name to me. :-) Where are you from? > I have a shutdown class that needs to be called when stopping the > daemon, and the way the sh script looks, it just kills the java > process without calling it. Is this true? I don't see the shutdown > class being activated in the logs… > The sh script that comes with the Wrapper stop the Wrapper by sending it a HALT signal. The Wrapper traps this and other signals and attempts to shutdown the JVM cleanly. Depending on the integration method that you used different things will happen. If you are using Integration Method 1 (WrapperSimpleApp) then the JVM will be shutdown with a call to System.exit. In order for your shutdown class to be run in this case, your application will have to register its own shutdown hook. See the java.lang.Runtime class for details on registering a shutdown hook. NOTE - What JVM version are you using? Shutdown hooks were adding Java 1.3. Older versions will simple exit with Integration method 1. Integration Method 2 (WrapperStartStopApp) allows you to specify a shutdown class whose main method will be called on shutdown. This method works with all Java versions. Integration Method 3 (WrapperListener) is more involved and requires that you implement the WrapperListener interface yourself. In this method, your application knows when the JVM is being shutdown because the listeners stop method is called. This also works with all Java versions. Hope this helps. Let me know if you have more questions. > (As NT service on windows it works fine) > Strange. If it works on NT, it should also be working on *NIX with the same wrapper.conf file. If you are not able to get it working, please post your wrapper.conf file and the contents of your wrapper.log file for a SINGLE Wrapper invocation. Add the wrapper.debug=true property to the conf file before creating the log output it is very informative. > Should I just enter a call to another shutdown sh there? That seems > like ignoring the conf file and going back to scripts, which feels wrong. > You should not need to be doing that. The existing scripts should do everything you need. Lets get them working for you. Cheers Leif |