-
1. Re: Session already invalidated exception
gfzhang Sep 27, 2004 10:01 PM (in response to erezharari)try HttpSessionBindingListener
-
2. Re: Session already invalidated exception
erezharari Sep 28, 2004 2:04 AM (in response to erezharari)HttpSessionBindingListener is used to notify on attributes bunding, while HttpSessionListener notifies on session creation and destruction.
i need to clean resources on session level when session gets destroyed.
this worked fine on jboss 3.2.4, but not on 3.2.5. -
3. Re: Session already invalidated exception
alanmoor Oct 13, 2004 8:21 AM (in response to erezharari)I've used this without incident in 3.2.5 and several versions back:
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent httpSessionEvent) {
/**/
String sessid = httpSessionEvent.getSession().getId();
if (sessions.containsKey(sessid)) {
sessions.remove(sessid);
}
context.setAttribute("ConXons.Sessions",sessions);
log.debug("removed session for "+httpSessionEvent.getSession().getId());
/* */
}
"sessions" is a synchronized HashMap used to store information about logged in users, i.e. what screen they last loaded, when they logged on, etc.
Hope this helps -
4. Re: Session already invalidated exception
erezharari Oct 21, 2004 9:10 AM (in response to erezharari)but u have not called session.getAttribute("key");
would u try that? -
5. Re: Session already invalidated exception
erezharari Nov 24, 2004 2:21 AM (in response to erezharari)SO I CANNOT REFERENCE SESSION ATTRIBUTES ON SESSION LISTENER?
-
6. Re: Session already invalidated exception
darranl Nov 24, 2004 6:27 AM (in response to erezharari)The word 'destroyed' means that is has already happened. i.e. The session has already been destroyed.
The API documentation also says 'Notification that a session was invalidated', the was in the extract from the API indicates that it has already happened.
The error that you are getting is 'Session already invalidated' which fits with the name of the method being invoked and the description in the API. -
7. Re: Session already invalidated exception
erezharari Nov 24, 2004 7:09 AM (in response to erezharari)opps,
u are right - this is different that in ServletContextListener.contextDestroyed():
Notification that the servlet context is about to be shut down -
8. Re: Session already invalidated exception
darranl Nov 24, 2004 7:16 AM (in response to erezharari)Yes looking at the ServletContextListener API the name of the method and the description of the method contradict each other.