This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Implicit session object becomes null in JSP  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have a jsp page which is refreshed atuomatically every 10 seconds.I get and put values in the session by using the implicit session variable .
Everything works fine for say 2-3 mins after that the implicit session becomes null suddenly and throws a null pointer exception.
I get a null pointer exception and session is printed as null but even the if block (session == null) is not executed .
I printed the value of request.getSession(false);.This gives me session object ,where as the implicit session does not have this after many refresh interval
During the first few refreshes both have the same value.
Also note that this runs fine in Windows ,I get this problem only in UNIX .
I use tomcat in unix and view using IE in windows
if (session == null){
System.out.println("session is null:::");
if (session.isNew()) {
response.setHeader("Refresh","1; URL=/MCOne/BP/index.html");
} catch (Exception e) {
System.out.println("I am in exception ");
System.out.println("I am after hello ::::"+request.getSession(false));
I have been looking into this problem for a long time now and need other ideas on the above
I have tried and confirmed all these
1.Only one browser is open so only one session,no other load on server
problem occurs in NN and IE .
2.I do not invalidate the session in any code and I use only request.getSession(false); and nothing else so guess no new session created
3.When implicit object session becomes null ,the request.getSession(false) continues to have the value dont know why only the session becomes null
4.Also implemented the session listener and found that the sessionid is same and session is not destroyed when null pointer exception occurs
Sorry for the long mail
[Bear: edited to remove shouting from subject line]
[ April 21, 2004: Message edited by: Bear Bibeault ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!