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

java.lang.IllegalStateException: HttpSession is invalid

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We get this exception very frequently, it says something like "HttpSession is invalid" and then "ReplicatedSessionData.setAttribute", does anybody have any idea on this?. What i understood is if we try to get/set from the session after invalidating it, we would get "HttpSession is invalid", but in our current flow we didnt invalidate the session at all. Is it something to do with "Weblogic" (ReplicatedSessionData) or cluster?? Please advice

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naresh, I use Tomcat (not Weblogic) as my application server. However, just to rule out the obvious, could this session have expired in accordance with your config. Since you say that you have not invalidated the session anywhere in your application code, is it possible that your session timeout value in your web.xml or weblogic.xml file is set too low?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you hanging on to a session reference between request-response cycles? Thats a no-no, the container is responsible for managing the session, you should get a fresh reference with each request.

Bill
 
Naresh Shanmugam
Ranch Hand
Posts: 93
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Vanessa and Bill, We finally found the root cause of this issue, it is because the user does a double click on a link within a nano seconds(duplicate click), so the application receieves couple of requests, where the first request ends up with the exception due to the business requirement and it invalidates the session, and the second request(which is nothing but a duplicate submit by the user) is trying to access the same session which was invalidated, thats the reason for this exception. I am posting this because it might be useful for someone else,, thank you..
 
The moustache of a titan! The ad of a flea:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic