You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2010/01/20 18:21:39 UTC

Resrouce bundles intermittently not getting loaded when in clustered environment

I am not sure whether it is directly a Struts problem but I'm hoping someone
will be able to suggest a way around.

I have the following in my struts.properties file:
struts.custom.i18n.resources=MyResource

MyResource.properties resides in WEB-INF/classes of my application.

In my JSP I simply do the following:
<s:text name="my.text.label1"/>


Everything seems to work but sometimes we literally see 'my.text.label1' in
the browser instead of seeing the value. Once this happens...it stays for
the whole session. we close the browser...open new window (session) and then
most of the time it goes away. so it is really intermittent.

We are in a clustered environment where multiple Struts2 applications are
deployed on Glassfish server and all the WAR applications share the
struts2-core.jar.

We have noticed that this error goes away when following properties are
placed in struts.properties:
struts.devMode = true
struts.i18n.reload= true

the above properties will reload the resource bundles on each request.  We
do not want to do this in production.

So I finding out what are some other alternative ways of access properties
file in struts2? Will placing them in ActionClasses make a difference?

Thanks!
-bhaarat