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
objects. 
Here is my session entry in the web.xml
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

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.     http://www.ml.com/email_terms/
--------------------------------------------------------

Reply via email to