users@glassfish.java.net

Glassfish + Struts2 caching problem

From: Bhaarat Sharma <bhaarat.s_at_gmail.com>
Date: Tue, 20 Apr 2010 19:34:16 -0400

We encounter an issue where a clustered Glassfish server holds multiple
Struts2 application. Struts2 has a file called struts.xml which holds the
configurations/actions/results etc. Each application has its own
struts.xml. The jar's needed for struts2 are all placed inside the
glassfish lib. So all the applications use struts2 jars placed in glassfish
lib and dont have their own jars.

Now the issue we have is weird and dont know whether it is glassfish issue
or struts2. Intermittently we start seeing errors like "There is no action
mapped for namespace ... and action ...." This error comes from struts2 when
it can not find the action name or namespace in the struts.xml. However, we
know that it is there and it does work sometimes and sometimes it does not
work.

After digging deeper into struts2 I found out that Struts places the
struts.xml into a cache and it is picked up from the cache. This leads me
to believe that intermittently either it is not having access to struts.xml
OR struts.xml disappears from the cache altogether.

Can someone shed some light on how to investigate this issue further? Is
there a way to see what is in the cache??

Thanks
-bhaarat