Telling Tomcat Not to Save Sessions
Join the DZone community and get the full member experience.Join For Free
so a few days ago, i noticed that on every restart, tomcat was trying to save sessions and then restore them. we are doing software development, that is a completely stupid waste of time. nevermind the lean dictates about vsm maps, the joke about the runner who goes to the doctor and complains of his knee hurting applies. doctor puts him up on the table and taps it and says ‘does that hurt?‘ and when they guy says no, he says ‘it would if i did it 10,000 times.‘ here‘s where i made a fatal error though: i thought, ‘wait, let me just look this up and fix it, it must be simple.‘
of course, there are 3 different branches of tomcat code that are still in pretty wide use (5.x, 5.5.x, and 6.x) so using google to even find the answer was hellish and stupidly slow. in the old days, you had to add a manager tag in the server.xml. in newer versions, that tag has to be inside context.xml. and of course, that file could be in the server install or in your war (another sore spot in the sucky config silliness that is tomcat).
eventually, the key was to open up the servers node in eclipse, go into the context.xml. but as is always the case in the java world, when you think you have finally found the key, you have to put it in the lock at least 3 or 4 times, do a couple cleans, sacrifice a small hen, oh, wipe the work area, and do add/remove again.
so find servers in your package explorer, then drill that open, and drill open the tomcat node comme ça:
then uncomment the manager tag:
why am i using tomcat? well, this is a 5.x project (that we are about to move to 6) and jb6 is slower on restarts.
some would say we reached the t. j. eckleberg state in java a long time ago. it‘s a state of simultaneously dusty immersion in dead stuff, and yet, still furious mutated wages of industry. fitzgerald‘s working title for gatsby was among ash heaps and millionaires i kind of like bowie‘s rendition of this: the failed spaceman as a returned wanderer in the land of the dead. the key thing is that those who live there don‘t realize that it is an ash heap… have we reached eliot‘s wasteland in the java world? i think when you compare it on a qc basis with ios, it‘s utterly laughable. 90% of the stuff out in the world on the java side would never have donned the alpha moniker from apple. problem is, when you say that to a lot of java people, they just go beavis on you. yet, i talk to more and more people who have grown utterly weary of the toll of trudging through the dust… (click on the t.j. eckleberg pic for a cool article on the actual site of wilson‘s garage…)
Opinions expressed by DZone contributors are their own.