tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Larsen" <lar...@qec.com>
Subject Re: Session already invalidated
Date Tue, 09 Apr 2002 18:31:29 GMT
Hmmm... The IllegalStateException must be getting caught within
the session.invalidate() code and then throwing another exception
which generates the error page. 

For debugging, catch (Exception e) and then System.out.println(e.getClass()).
You then know what exception to catch, but it might not be a good idea
to have too broad a catch.

My question (and one that you may need to be asking yourself) is:
Why do you need to store the HttpSession objects and why is it so
important that you invalidate them before replacing them in your
HashMap? Couldn't you just overwrite them in your HashMap and
forget about them?

Jeff

----- Original Message ----- 
From: "Rick Roberts" <techinfo@ait-web.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 11:44 AM
Subject: Re: Session already invalidated


> This seems reasonable to me.  In fact someone had suggested this in the 
> archives some months ago to someone elses query about this same issue.
> 
> But when I do this.  The exception is still passed to my error page.
> 
> Do you know of anyway to prevent that?
> 
> Thanks for the help.
> 
> Rick
> 
> 
> 
> Jeff Larsen wrote:
> 
> > Part of the problem may be that you're grabbing a session object
> > that you have stored in your own data structure. Tomcat doesn't
> > know anything about your monitor HashMap and is not going to update
> > it when it invalidates a timed-out session.  
> > 
> > Why don't you do this:
> > 
> >   try {
> >     oldSession.invalidate();
> >   } catch (IllegalStateException ise) {
> >     // do nothing, if it's already invalidated, we're happy
> >   }
> > 
> > Jeff
> > 
> > 
> 
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message