-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Andrew,
On 1/28/13 2:18 PM, Andrew Kujtan wrote: >> -----Original Message----- From: Christopher Schultz >> [mailto:ch...@christopherschultz.net] Sent: Monday, January 28, >> 2013 2:01 PM To: Tomcat Users List Subject: Re: Restarting Tomcat >> from within itself? >> > Andrew, > > On 1/28/13 1:49 PM, Andrew Kujtan wrote: >>>>> -----Original Message----- From: Christopher Schultz >>>>> [mailto:ch...@christopherschultz.net] Sent: Monday, January >>>>> 28, 2013 10:33 AM To: Tomcat Users List Subject: Re: >>>>> Restarting Tomcat from within itself? >>>>> >>>> Daniel, >>>> >>>> On 1/28/13 8:19 AM, Daniel Mikusa wrote: >>>>>>> On Jan 26, 2013, at 5:19 AM, Sunil Shevante wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> Is it possible to restart tomcat from within itself? >>>>>>>> >>>> >>>>> FWIW, It is possible to restart tomcat by calling, >>>> >>>>> org.apache.catalina.startup.Bootstrap.main(new String[] { >>>>> "stop" }); >>>> >>>>> then use a shutdown hook to start it up again, >>>> >>>>> But I really don't recommend it. > > What would your shutdown hook do, then? > > -chris > >> Just use a ProcessBuilder to call the startup script in a new >> process. This seems like a risky proposition (I suppose no less risky than using -XX:OnOutOfMemoryError). If you run Tomcat under jsvc (or as a Windows Service), I believe you can configure both of those strategies to re-start Tomcat if it stops for some reason. In that case, a simple System.exit() will shut-down Tomcat (or you can send a SHUTDOWN command to your own shutdown port) and the service-monitor can re-start it. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEAREIAAYFAlEG7REACgkQ9CaO5/Lv0PDDVgCfQHgkF6c1ohuWY20iFJuVkigs RewAnRLNVNwJye7t8YhlZoKx/C920bj7 =I1SP -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org