• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Session already invalidated

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All -

I'm not able to find out what's causing this error.


type : Exception report

message :

description : The server encountered an internal error () that prevented it from fulfilling this request.

exception :

java.lang.IllegalStateException: getAttribute: Session already invalidated
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:984)
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:109)
Main.doGet(Main.java:60)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


note : The full stack trace of the root cause is available in the Apache Tomcat/5.5.8 logs.


Am I using the session wrong way ? Really appreciate any suggestions. Thanks

 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You problem is that the session is an instance variable, there is only one variable and all of your rerquests end up sharing it. Move it inside the method instead so there will be one per thread instead.

Dave
 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave, Thanks for the responese.

I'm little bit puzzled about sessions. I would like to set some default values to session variables when the user first time comes to the web page via servlet. Later the values for session variables chaanges based on user selecting differing parameters. If I move HttpSession session; inside the
goGet how I do I know whether it is new seesion of existing session.

Thanks again.
 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will try

HttpSession session = req.getSession(true);

if (session.isNew()) {

} else {

}

Thanks
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic