tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Skidmore, Donald \(GTI PE\)" <>
Subject RE: Sessions in Tomcat
Date Tue, 01 Aug 2006 16:54:43 GMT
Cookies are turned on and I see the jsessionid in the url. I have even
deleted the cookie and tried a refresh of the page. It recreates the
cookie but I still get the same null pointer exception. The only way I
have been able to get around the problem is to do a reload. I am running
Tomcat 5.0. I have tried two different machines with the same results.
Both are running Windows XP. I have even coded all the jsp pages to go
back to the jsp that has the directive page session="true" and where it
sets the attributes. Still no success.

-----Original Message-----
From: Christopher Schultz [] 
Sent: Tuesday, August 01, 2006 12:46 PM
To: Tomcat Users List
Subject: Re: Sessions in Tomcat

* PGP Signed by an unknown key: 08/01/2006 at 12:46:13 PM Donald,

> The first browser session works fine and I can
> navigate thru all my pages without a problem. A few minutes later I 
> open another browser window and I immediately get a null pointer 
> exception.

Is it possible that you are have cookies turned off and are having the
JSP encode the jsessionid into each URL? If that's the case, you might
be simply typing a URL into your second browser window that doesn't have
this magic parameter, and therefore not getting a session.

> [After a restart, ] both browser sessions bring to work normally, the 
> original browser continues as if nothing happened and the second 
> browser session loads without the null pointer exception.

No, that's just plain weird.

> Is there something I am not setting?
> Even more bizarre, after I do a reload of the website if I open two 
> browser windows very quickly they both succeed. When I let a browser 
> window sit with no activity for more than two or three minutes and I 
> click to a link to navigate thru my jsp pages I immediately get a null

> pointer exception anywhere I am accessing the one of the session 
> objects.

Hmm... perhaps your browser is configured to prohibit cookie life longer
than a couple of minutes??? Seems far-fetched, but you've got a weird

How are you getting your session? Can you post a bit of code? It would
be particularly useful to see the code you use to create the session, to
get the attributes (as well as verify that the session exists), and then
the place where the NPE is being thrown.


* Unknown Key
* 0xF2EFD0F0

If you are not an intended recipient of this e-mail, please notify the sender, delete it and
do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important
additional terms relating to this e-mail.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message