I've added a listener instance and notifications start working! Thank you for the answer!
----- Original Message ----- From: "Jon Wingfield" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, August 19, 2003 7:31 PM Subject: Re: shutdown tomcat > So you added an instance of TestTomcatNotifications to a session as an > attribute? That's the only way you'll get HttpSessionActivationListener > events. > > You added a listener element to your web.xml registering > TestTomcatNotifications as a HttpSessionListener? > On shutdown sessionDestroyed(...) doesn't get called because the > StandardManager persists sessions and doesn't destroy them. > > Let us know if you still don't get the sessionWillPassivate(...) event > coz that would worry me. > > Jon > > Maksimenko Alexander wrote: > > > Hi! > > I created the following implementation of HttpSessionListener,HttpSessionActivationListener. > > > > public class TestTomcatNotifications implements HttpSessionListener, HttpSessionActivationListener { > > public void sessionCreated(HttpSessionEvent se) { > > System.out.println("TestTomcatNotifications.sessionCreated(se)"); > > } > > public void sessionDestroyed(HttpSessionEvent se) { > > System.out.println("TestTomcatNotifications.sessionDestroyed(se)"); > > } > > public void sessionWillPassivate(HttpSessionEvent se) { > > System.out.println("TestTomcatNotifications.sessionWillPassivate(se)"); > > } > > public void sessionDidActivate(HttpSessionEvent se) { > > System.out.println("TestTomcatNotifications.sessionDidActivate(se)"); > > } > > } > > > > So this class logs that some method was invoked only. But when I am shut down tomcat neither sessionWillPassivate nor sessionDestroyed are been invoked. In API Doc we can read that: > > "A container that migrates session between VMs or persists sessions is required to notify all attributes bound to sessions implementing HttpSessionActivationListener". > > What's wrong? > > > > P.S. I use org.apache.catalina.session.StandardManager implementation. > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]