Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear all sessions for web application in tomcat 7

I'm trying to update a couple of JAR files after my web application starts and doing a restart for the changes to take effect.(requirement) The problem is , the session information is being persisted by tomcat. Yes, I do have a "sessionEventListener" listener in my application, but that shouldn't be a problem IMHO.

I want everything to start afresh from tomcat ( running standalone) , be it sessions, cache, or any information about the web application given to tomcat, except for the WAR file of course.

Any help would be appreciated.

like image 700
Gyan Avatar asked Aug 02 '12 06:08

Gyan


2 Answers

During development (in Eclipse) I usually use 'Clean Tomcat Work Directory' option found when right clicking on Servers view. That will wipe all session related data.

like image 145
Kennet Avatar answered Oct 23 '22 17:10

Kennet


In your tomcat 7 context.xml you can add/uncomment this line to clear all sessions on tomcat restart.

<Manager pathname="" />
like image 28
Nikhil Avatar answered Oct 23 '22 16:10

Nikhil