users@glassfish.java.net

clusterjsp sample losing session data

From: <glassfish_at_javadesktop.org>
Date: Sun, 10 Aug 2008 20:30:05 PDT

Hi all,

I am having considerable problems getting session replication (availability) working in a glassfish cluster.

I really have no idea what is going on. My web app is a fairly simple servlet that uses numerous frames (unforunately - it is legacy stuff) and I lose the session after the first few requests.

I have tried Glassfish V2 UR2, and Glassfish V2.1 b45 with no success.

To simplify things I set up a two instance cluster on my Windows XP development machine and deployed the sample clusterjsp.ear (with availability enabled). No loadbalancer, etc, just accessing localhost:38080/clusterjsp and 38081 directly.

I can then add session data and click reload page and see the data being stored. I can then switch between localhost:38080/clusterjsp/HaJsp.jsp and localhost:38081/clusterjsp/HaJsp.jsp and see the session data replicated. I can click reload page on either instance and see my session data still survives. I can seem to do this indefinitely and the session is maintained.

As soon as I hold down the reload key (F5 in Firefox 3) the page loads a few times with the existing session then the session disappears. If I keep holding down the reload key I can see the session id changing every few seconds. In the server.log (for Glassfish V2UR2) I keep seeing the following message:

findSessionViaBroadcast for id: <changing session id> took: 4000 ms

According to https://glassfish.dev.java.net/issues/show_bug.cgi?id=4418 this is a broadcast timeout. This had apparently been fixed in Glassfish V2.1 which is why I tried b45 - but no luck.

Can someone please try this simple test? Deploy the clusterjsp.ear from the glassfish samples directory into a simple cluster, add a session parameter, then just hold down refresh in the browser. I am using Firefox... not sure if that will make a difference.

I am really tearing my hair out over this and would appreciate some help. I can't understand why it is not working because this seems like a straightforward problem!

Regards
Cameron
[Message sent by forum member 'cameronr' (cameronr)]

http://forums.java.net/jive/thread.jspa?messageID=292510