You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pierre Lavignotte <pi...@gmail.com> on 2009/04/14 14:52:07 UTC

ActionContext on cluster platform

Hi all,

I'm using Struts 2 into Jonas v4.8.4 in a cluster environment.
There are two Jonas servers that are set in cluster mode and share the user
sessions.
In front of that, a DX balances the requests to the Jonas servers.

Everything works great except on some specific pages where we get exceptions
or unexpected behaviours that doesn't occur when we are not in cluster mode.
After (very long) investigation I've found this occurs when we use
ActionContext.getContext().getSession().get(attributeName) to retrieve a
value from the user session.

At a specific page, we put a value in session. At the next page, we try to
retrieve this value by calling
ActionContext.getContext().getSession().get(attributeName) but this return
null.
If I refresh the page, the same request is sent to the other Jonas server
and I can get the value correctly, so the application is not crashed or
anything.
If I use request.getSession().get(attributeName) instead, I allways get the
correct value.

Has anyone ever had the same problem ?
Any help very appreciated.

Thank you,
Pierre

Cordialement,
Pierre Lavignotte
Ingénieur Conception & Développement
http://pierre.lavignotte.googlepages.com