• 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

Tomcat randomly invalidating sessions

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

I am having some trouble with my tomcat application. It randomly removes sessions and forces the user to log back in again. This only happens when the app is run with other applications on the same server. If I run it with a fresh Tomcat install with nothing else, it seems to run fine. I am using Tomcat 7.0.42 with JVM 1.7.0_07-b11 and on Windows Server 2008 R2. Any help is much appreciated.

I cross posted this on Stack Overflow.
 
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are all your root paths the same ? ie. Are all your application's files under one parent directory ?

This symptom can be caused by the browser not sending the session cookie when it has to load two different context root paths for different files ( .htm under one context and .jpeg under another context path ).


This is especially poignant since it works well with only the app loaded and nothing else.
 
Bryan Perino
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each application is under a different path. I created a HttpSessionListener that is never triggered. This application only has 2 jsp files. The front end is done in AngularJS, so I don't know if there is a way to trigger session generation with that. The backend is Hibernate and Spring. I did notice a cookie mistmatch when the error happens



Edit:

There is however a lot of cross path communication between my app, which has two paths.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the Tomcat manager show that the context has been deployed as a single web app?
 
Bryan Perino
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that the app is a single context, /rdk. However, it talks to RDKServer which is a separate one.



/rdk is the AngularJS app which talks to the RDKServer which handles all the data transactions and doesn't have any session associates with it.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So all of your session woes are within the /rdk context?
 
Bryan Perino
Greenhorn
Posts: 6
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I actually think that I solved it. The issue had to do with persisting the sessions on disk. For some strange reason, it wasn't working and kept killing them. I had to change the following in context.xml from this



to this



Everything seems fine now. Thank you for the help.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting back with your findings!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic