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.

Reply via email to