Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 85366 invoked from network); 26 Nov 2003 19:58:02 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 26 Nov 2003 19:58:02 -0000 Received: (qmail 74432 invoked by uid 500); 26 Nov 2003 19:57:31 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 74420 invoked by uid 500); 26 Nov 2003 19:57:31 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 74398 invoked from network); 26 Nov 2003 19:57:30 -0000 Received: from unknown (HELO maingate.mkodo.com) (217.158.103.214) by daedalus.apache.org with SMTP; 26 Nov 2003 19:57:30 -0000 Received: from smtp.uk1.mkodo.com (smtp.uk1.mkodo.com [192.168.11.233]) by maingate.mkodo.com (8.11.2/8.11.2) with ESMTP id hAQJva930548 for ; Wed, 26 Nov 2003 19:57:36 GMT Received: from mkodo.com (jjwlaptop.uk1.mkodo.com [192.168.11.239]) by smtp.uk1.mkodo.com (8.12.8/8.12.8) with ESMTP id hAQJvUkf021749 for ; Wed, 26 Nov 2003 19:57:35 GMT Message-ID: <3FC505EA.60406@mkodo.com> Date: Wed, 26 Nov 2003 19:58:34 +0000 From: Jon Wingfield User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener in general) References: <9C5166762F311146951505C6790A9CF8013DF768@US-VS1.corp.mpi.com> In-Reply-To: <9C5166762F311146951505C6790A9CF8013DF768@US-VS1.corp.mpi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Lukas, Check the difference in the javadoc for HttpSessionListener between servlet specs 2.3 (J2EE 1.3) and 2.4 (J2EE 1.4). In 2.4 containers the session should (as I read it) still be valid in sessionDestroyed(...). Jon J2EE 1.3: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html J2EE 1.4: http://java.sun.com/j2ee/1.4/docs/api/index.html Shapira, Yoav wrote: > Howdy, > By the time sessionDestroyed is call, the session has been invalidated. > That doesn't mean you can't get information about it: only certain > information ;) HttpSession#getAttribute is clearly documented to throw > an IllegalStateException if called on an invalidated session. > > If you're interested in attributes, implement an HttpSessionAttribute or > Binding listener. In it, you will be notified when an attribute is > removed and you will be able to access its value. > > Yoav Shapira > Millennium ChemInformatics > > > >>-----Original Message----- >>From: Lukas Bradley [mailto:lukas@somnia.com] >>Sent: Wednesday, November 26, 2003 1:07 PM >>To: tomcat-user@jakarta.apache.org >>Subject: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener > > in > >>general) >> >>All, >> >>When I attempt to access the HttpSession object within the >>sessionDestroyed(), I get the following error. >> >>DEBUG [StandardManager[]] (SessionListener.java:40) - > > sessionDestroyed() > >>StandardManager[] Session event listener threw exception >>java.lang.IllegalStateException: getAttribute: Session already > > invalidated > >> at >>org.apache.catalina.session.StandardSession.getAttribute(StandardSessio > > n.ja > >>v >>a:954) >> at >>org.apache.catalina.session.StandardSessionFacade.getAttribute(Standard > > Sess > >>i >>onFacade.java:171) >> at >>dollars.ui.actions.DollarsAction.getUserVO(DollarsAction.java:46) >> at >>dollars.ui.controllers.SessionListener.sessionDestroyed(SessionListener > > .jav > >>a >>:42) >> at >>org.apache.catalina.session.StandardSession.expire(StandardSession.java > > :659 > >>) >> at >>org.apache.catalina.session.StandardSession.expire(StandardSession.java > > :608 > >>) >> at >>org.apache.catalina.session.StandardManager.processExpires(StandardMana > > ger. > >>j >>ava:793) >> at >>org.apache.catalina.session.StandardManager.run(StandardManager.java:87 > > 0) > >> at java.lang.Thread.run(Thread.java:536) >> >>Why would the HttpSessionEvent *seem* like it should have access to the >>session that has just been removed, yet not be able to access it? Is > > this > >>a >>Tomcat problem, or does the Servlet 2.3 spec simply want you to know > > that > >>some random session was just invalidated, but you can't get any > > information > >>about it. >> >>Any help appreciated. >> >>Lukas >> >> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org