tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Shutdown Hooks not firing when tomcat is shutdown from within a webapp
Date Wed, 08 Feb 2012 17:17:46 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew,

On 2/7/12 5:20 PM, Andrew Kujtan wrote:
> Runtime.getRuntime().addShutdownHook( new Thread(new Runnable(){ 
> @Override public void run() { System.out.println("HARI-KIRI
> SUCCESSFUL!"); } }, "shutdownHook"));

Note that if this code is running in the webapp, you are getting into
WebappClassLoader issues. Not sure if those are relevant, but if the
classes you expect to use in the shutdown hook are located in lib/ but
the above code is in a class in the webapp, then the anonymous inner
class you are creating (an anonymous Runnable) will itself be loaded
by the WebappClassLoader.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8yrjoACgkQ9CaO5/Lv0PCH6gCdER2wQZ2kyBUAPb5YSGBQsrwj
QJIAnj64mFbAF4qUiZDnQQscKhiOP+2v
=lY0Y
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message