0 Replies Latest reply on May 6, 2002 9:07 AM by Andrew Samsonov

    Session listener & getAttribute

    Andrew Samsonov Newbie

      Hi folks,
      I have SessionListener class implements HttpSessionListener.

      I have following function
      public void sessionDestroyed(HttpSessionEvent event) {
      HttpSession session = event.getSession();
      MyObject myObj = (MyObject)session.getAttribute("MyObject");
      }

      and I get exception
      16:32:09,970 ERROR [STDERR] java.lang.IllegalStateException: getAttribute: Session already invalidated
      16:32:09,971 ERROR [STDERR] at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:900)
      16:32:09,971 ERROR [STDERR] at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:171)
      16:32:09,971 ERROR [STDERR] at my.web.listeners.SessionListener.sessionDestroyed(SessionListener.java:37)
      16:32:09,972 ERROR [STDERR] at org.apache.catalina.session.StandardSession.expire(StandardSession.java:617)
      16:32:09,972 ERROR [STDERR] at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:755)
      16:32:09,972 ERROR [STDERR] at org.apache.catalina.session.StandardManager.run(StandardManager.java:832)
      16:32:09,972 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
      Question:
      How can I get something attribute on sessionDestroyed(...)?
      Attribute has been setting before.
      Best regards Andrew