|
From: Leif M. <lei...@ta...> - 2012-10-03 03:57:57
|
Ronen, 1) Looking at the log output, I do not see any sign that the Wrapper's java class is being invoked. Could you please send your wrapper.conf so I can see exactly what you are doing? Most likely the main class is your class directly rather than using one of the Wrapper's helper classes. Please take a look the integration methods. Most likely Method #1 will work for you. If this is the problem then most likely the Wrapper would have timed out on startup after 30 seconds or so as it was waiting for the WrapperManager class to initialize itself. http://wrapper.tanukisoftware.com/doc/english/integrate.html 2) Also, please try turning on wrapper.debug and this will show you/me a lot more information about what is happening. wrapper.debug=true 3) You might also want to try adding a println just inside your bindShutdownHook() to make sure that it is getting called as expected. It probable is as you said, but I don't have source and there is no feedback in the log. :-) Cheers, Leif On Tue, Oct 2, 2012 at 3:55 PM, Ronen Itzhaki <rit...@al...> wrote: > ** > > Hi Leif,**** > > ** ** > > First, thanks for quick reply!**** > > ** ** > > I did as instructed, and as I was suspecting, it seams like my hook isn’t > called L – I don’t see it in the dump (nor I see its output in the log). > All I see is my main thread sleeping…**** > > ** ** > > The log is attached.**** > > ** ** > > I'm using the simplest way to bind my shutdown hook:**** > > ** ** > > *static* *void* bindShutdownHook()**** > > {**** > > Runtime.*getRuntime*().addShutdownHook(*new* Thread()**** > > {**** > > @Override**** > > *public* *void* run()**** > > {**** > > System.*out*.println("Shutting down...");**** > > *try***** > > {**** > > *monAction*("stop"); // returns within 1 sec**** > > }**** > > *catch* (IOException io)**** > > {**** > > io.printStackTrace();**** > > }**** > > }**** > > });**** > > }**** > > ** ** > > The method bindShutdownHook is called as the first thing in the main. **** > > ** ** > > Ronen.**** > > ** ** > > ** ** > > ** ** > ------------------------------ > > *From:* Leif Mortenson [mailto:lei...@ta...] > *Sent:* Sunday, September 30, 2012 2:35 PM > *To:* wra...@li... > *Subject:* Re: [Wrapper-user] WrapperSimpleApp: Shutdown hook isn't called > **** > > ** ** > > Ronen, > Please set the following property. It will request that the Wrapper does > a thread dump when timing out before shutting down. > > http://wrapper.tanukisoftware.com/doc/english/prop-request-thread-dump-on-failed-jvm-exit.html > wrapper.request_thread_dump_on_failed_jvm_exit=TRUE > > The fact that the JVM is failing to exit means that the one of the > shutdown hook threads is still running and failing to complete in a timely > manner. The thread dump will hopefully show you exactly what state your > threads are in on shutdown. > > Please let me know how this works for you. > > Cheers, > Leif**** > > On Sun, Sep 30, 2012 at 9:19 PM, Ronen Itzhaki <rit...@al...> wrote: > **** > > Hi,**** > > **** > > I'm using community license for WrapperSimpleApp.**** > > I am trying to run my services with console first (as you've recommended > in order to make sure everything works properly). When I press the CTRL+C > my shutdown hook isn't called, and I get timeout message in the wrapper's > console (nothing else significant in the log):**** > > **** > > wrapper | CTRL-C trapped. Shutting down.**** > > wrapper | Shutdown failed: Timed out waiting for signal from JVM.**** > > wrapper | JVM did not exit on request, terminated**** > > wrapper | <-- Wrapper Stopped**** > > **** > > Note that when I run my app from a command line or simple bat file, the > shutdown hook does get executed when CTRL+C is pressed:**** > > **** > > **** > > Details:**** > > OS: winXP/win7**** > > Wrapper: wrapper-windows-x86-32-3.5.15.zip**** > > Conf file is attached**** > > **** > > Thanks!**** > > **** > > Ronen.**** > > > |