tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Listener Shutdown Order?
Date Wed, 14 Nov 2007 18:25:51 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jim,

Jim Garrison wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>> 
>> "Notification that the servlet context is *about* to be shut down.
>> All servlets and filters have been destroy()ed before any 
>> ServletContextListeners are notified of context destruction."
> 
> What I'm seeing is that servlet destroy() is being called AFTER the 
> listeners have been shutdown.  If I'm reading the quote above right, 
> this shouldn't happen; servlets should have already been destroy()ed 
> before the listener is shutdown.

Hmm. How are you observing this? Logging statements? Do they have
timestamps? I'm wondering if you're potentially seeing things out of
order. Otherwise, this is a bug in Tomcat. Which version?

> The problem is that the non-Spring servlet needs to notify a Spring 
> based component to shutdown, and can't get to it after the Spring 
> ApplicationContext is gone.

Wait.. what is trying to notify what in this scenario. Shouldn't the
ServletContextListener be the one sending the shutdown message? Don't
you initialize Spring in the same ServletContextListener? If that's the
case, keep a reference to whatever you need in the
ServletContextListener object and then use it directly instead of trying
to get that object from somewhere else.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOz2u9CaO5/Lv0PARAqAZAJ40WTchkvVsDaQUwJJ6ur22iZ1ogwCgrSF6
V9uDUV44qmivx48r3v0WRKU=
=nW2U
-----END PGP SIGNATURE-----

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


Mime
View raw message