Over a million developers have joined DZone.
Platinum Partner

Telling Tomcat Not to Save Sessions

· Java Zone

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.

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…)


From http://www.jroller.com/robwilliams/entry/telling_tomcat_not_to_save

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}