• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting parameter from the session throws IllegalStateException,after refresh it's OK

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

I have an application which creates session after logging in and all data are stored in the session. Sometimes when I open a page which has to read the parameter from the session using:
String autoRefresh = (String) my_session.getAttribute("autoRefresh");
this exception is thrown:
ErrorPage.jsp: java.lang.IllegalStateException: getAttribute: Session already invalidated
at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:953)

at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:171)

at myapp.SomeHandler.getCurrColText(SomeHandler.java:116)
...

Everything looks like the session doesn't exist anymore, but when I refresh the page which has to read the data from session, everything is ok. I have tried to log session id in the error page, page after the login(when session was created) and in page after the refresh, and it's the same session ID !

Do you have any idea, what's wrong ?

I use Tomcat 4.1.31 + JDK 1.3.1.

Miro
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you setting the my_session object variable?
reply
    Bookmark Topic Watch Topic
  • New Topic