|
From: Bob B. <bob...@gm...> - 2008-07-23 21:27:10
|
Trying out the Java Service Wrapper (e.g. 3.3.0 - Community Edition) and have been noticing a warning in the logs anytime I shut down the application (e.g. "JVM exited unexpectedly while stopping the application"). I did notice the comments about bug #945072 for a previous release (e.g. http://sourceforge.net/tracker/?func=detail&aid=945976&group_id=39428&atid=425187) , but I am not calling System.exit() (e.g. that I'm aware of) and this is just a test application (e.g. not doing much at this point, stops really quick). I am using method #3 as an integration method. Only thing I can think of that may be particular about my test application is that I am using an interrupt to stop the application (e.g. break out of a Selector loop). Anyways, just wondering if I should worry about this or just ignore it and move on. Thanks, Bob ---- The following log snippet comes from running under OSX. Same thing happens under Windows XP, although the noted warning message happens at a latter time under XP (e.g. right before the "Wrapper Stopped" STATUS message). ......... DEBUG | wrapperp | 2008/07/23 15:04:35 | read a packet PING : ping DEBUG | wrapperp | 2008/07/23 15:04:39 | send a packet PING : ping INFO | jvm 1 | 2008/07/23 15:04:39 | WrapperManager Debug: Received a packet PING : ping INFO | jvm 1 | 2008/07/23 15:04:39 | WrapperManager Debug: Send a packet PING : ping DEBUG | wrapperp | 2008/07/23 15:04:39 | read a packet PING : ping DEBUG | wrapper | 2008/07/23 15:04:43 | Signal trapped. Details: DEBUG | wrapper | 2008/07/23 15:04:43 | signal number=15 (SIGTERM), source="unknown" STATUS | wrapper | 2008/07/23 15:04:43 | TERM trapped. Shutting down. DEBUG | wrapper | 2008/07/23 15:04:43 | wrapperStopProcess(0) called. DEBUG | wrapper | 2008/07/23 15:04:43 | Sending stop signal to JVM DEBUG | wrapperp | 2008/07/23 15:04:43 | send a packet STOP : NULL DEBUG | wrapper | 2008/07/23 15:04:43 | Signal trapped. Details: DEBUG | wrapper | 2008/07/23 15:04:43 | signal number=20 (SIGCHLD), source="unknown" DEBUG | wrapper | 2008/07/23 15:04:43 | Received SIGCHLD, checking JVM process status. DEBUG | wrapper | 2008/07/23 15:04:43 | JVM process exited with a code of 0, leaving the wrapper exit code set to 0. WARN | wrapper | 2008/07/23 15:04:43 | JVM exited unexpectedly while stopping the application. INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: Received a packet STOP : INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: Thread, Wrapper-Connection, handling the shutdown process. INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: calling listener.stop() INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: Waiting for WrapperListener.stop runner thread to complete. INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: WrapperListener.stop runner thread started. INFO | jvm 1 | 2008/07/23 15:04:43 | 2008-07-23 15:04:43,074 68314 [WrapperListener_stop_runner] INFO com.rdb.servertest.ServerTest - Stopping.........0 INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: Send a packet STOP_PENDING : 60000 INFO | jvm 1 | 2008/07/23 15:04:43 | 2008-07-23 15:04:43,074 68314 [Thread-1] INFO com.rdb.servertest.ServerTest - Selector woke up......... INFO | jvm 1 | 2008/07/23 15:04:43 | 2008-07-23 15:04:43,074 68314 [Thread-1] INFO com.rdb.servertest.ServerTest - Shutting down. INFO | jvm 1 | 2008/07/23 15:04:43 | 2008-07-23 15:04:43,075 68315 [WrapperListener_stop_runner] INFO com.rdb.servertest.ServerTest - Stopped......... INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: WrapperListener.stop runner thread stopped. INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: returned from listener.stop() -> 0 INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: shutdownJVM(0) Thread:Wrapper-Connection INFO | jvm 1 | 2008/07/23 15:04:43 | WrapperManager Debug: Send a packet STOPPED : 0 STATUS | wrapper | 2008/07/23 15:04:43 | <-- Wrapper Stopped As far as my stop/start methods on my WrapperListener. public int stop( int exitCode ) { ServerTest.getLogger().log( Level.INFO, "Stopping........." + exitCode ); appThread.interrupt(); WrapperManager.signalStopping( 60000 ); try { appThread.join( 60000 ); } catch (InterruptedException ex) { ServerTest.getLogger().log( Level.INFO, "FYI, interrupt caught." ); } ServerTest.getLogger().log( Level.INFO, "Stopped........." ); return exitCode; } As far as what my application is doing at the time of shutting down (again, not much). public void doMain() { ... A bunch of initialization code .... while (!Thread.currentThread().isInterrupted()) { try { selector.select(); } catch (IOException ioe) { getLogger().log( Level.ERROR, "Exception caught in select statement", ioe ); break; } getLogger().log( Level.INFO, "Selector woke up........." ); ....Check what selector is ready and do something which is nothing at this point... } getLogger().log( Level.INFO, "Shutting down."); } |