tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Skidmore, Donald \(GTI PE\)" <>
Subject Sessions in Tomcat
Date Tue, 01 Aug 2006 15:28:56 GMT
I am running into a strange situation with my session using tomcat 5.0.I
have a jsp that puts two objects into a session which is used by all
succeeding jsp pages. 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. I
traced the problem to accessing the objects in the session. The jsp that
does a session.setAttribute("test",obj) works fine. When I do a
System.out.println("Contents of obj=",obj) I get the proper value. But
when I do a session.getAttribute("test") I get a null pointer exception.
I checked Tomcat/conf/web.xml and see the session-config element set to
30 minutes. When I added to the jsp to check if the session is invalid
do a request.getSession() to create a new session I get the same
results. I finally tried going into Tomcat's manager and doing a reload.
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. 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
Here is my session entry in the web.xml

Any help would be appreciated.

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.

  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message