|
From: Christian M. <chr...@ta...> - 2013-04-30 09:38:05
|
Hi Ani, if you hit CTRL-C twice, this tells the Wrapper to forcibly kill the JVM. At this stage, the JVM will also not be given the chance to execute its shutdown hooks. Apart from that the way you registered the shutdown hook looks ok to me. You can disable the function to forcibly kill the JVM on hitting CTRL-C twice by setting: wrapper.disable_forced_shutdown=FALSE http://wrapper.tanukisoftware.com/doc/english/prop-disable-forced-shutdown.html Hope this information helps you out. Best Regards, Christian Mueller Tanuki Software, Ltd. On Tue, Apr 30, 2013 at 6:17 PM, Ani <jad...@gm...> wrote: > Hi Christian > With below changes, I am able to launch and run my application > successfully. Thanks a lot. > The reason for which I chose JSW was to catch the windows service shutdown > signal in jvm. Now that I have service running I have registered shutdown > hook in my main class. So when I shut-down service , the shutdown hook > code should get called but on service shutdown the shutdown hook code isnt > executing. > Is there any config am I missing to achieve this? > I will be very helpful if you could share your thoughts and help me to > solve this issue. > > > > > On Fri, Apr 26, 2013 at 1:08 PM, < > wra...@li...> wrote: > >> chr...@ta... > > > > Perfect , application launched and running successfully. Thank you Sir. > But my clear up activity process are nt getting called on service stop. > I have registered shutdown hook in my main class , i.e. > EmbeddedJettyServer and the spring controller > in @preDestroy files. > -------------------------------------------------------- > Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { > @Override > public void run() { > System.out.println("%%%%%%%%%%%%% in shutdown hook"); > sLogger.info("%%%%%%%%%%%%% in shutdown hook"); > } > })); > -------------------------------------------------------------------- > @PreDestroy > public void dispose() { > sLogger.info("***********************in dispose PC"); > System.out.println("***********************in dispose PC"); > } > > ------------------------------------------------------------------------------------ > Below is the log when I ctrl + c or service stop > > wrapper | CTRL-C trapped. Shutting down. > wrapper | CTRL-C trapped. Forcing immediate shutdown. > wrapper | JVM did not exit on request, terminated > wrapper | <-- Wrapper Stopped > > --Ani > Pl Save the environment. Please don't print this email unless you really > need to. > > > > > |