tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Listener Shutdown Order?
Date Wed, 14 Nov 2007 18:25:51 GMT
Hash: SHA1


Jim Garrison wrote:
>> From: Christopher Schultz []
>> "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

Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message