Everytime I take up a task on adding Cluster Support to my j2ee application, the whole experience gets quite exciting with new kinds of challenges 🙂
In the past, it was with Weblogic, Websphere etc…and this time it was Glassfish 🙂
Ok, like many of you, I managed to setup the cluster environment in glassfish and deployed “ClusterJsp” application to check out Session Failover, Load balancing etc…
What I found was that, if I keep refreshing the ClusterJsp page 5 to 10 times, my Session Id keeps changing…going to say that Glassfish lost my session somewhere in between these requests.
After googling and bing’ing a lots, I managed to find this link, which explained the issue in detail.
Basically, we should add the following snippet in sun-web.xml
After adding the above entry, Glassfish started behaving as expected.
Now what I donot quite understand is, why was this behavior not made a default behavior !!!
I am sure there is a good reason for it, will update If I get to know.