Hello Struts2 Dev Group,

I have been facing one issue with Struts2 framework while running it on IBM
WebSphere Portal Server.  For the background purpose, I am having multiple
WAR (running Struts2 Portlet and Struts2 Servlet Framework) files within
single EAR.

We have resource bundle coming from the Database and thus being shared in
multiple WAR Files. We have configured the resource bundle at global, by
providing information in struts2.properties.

Now when I enable the development mode, Struts2 Resource bundle is behaving
in strange mode ie initially Resource bundle was not getting picked when I
declared them in struts.xml, however when I moved them to struts.properties
it started working. Still for each Resource Bundle call I am seeing
following error in the logs :

java.lang.NoSuchFieldException: cacheList
at java.lang.Class.getDeclaredFieldImpl(Native Method)
at java.lang.Class.getDeclaredField(Class.java:575)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.clearMap(LocalizedTextUtil.java:877)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.reloadBundles(LocalizedTextUtil.java:837)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.findDefaultText(LocalizedTextUtil.java:197)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.getDefaultMessage(LocalizedTextUtil.java:690)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:550)


​I looked at the source code and found that ​LocalizedTextUtil class is
doing something weird [LocalizedTextUtil.java:837] where it tries to access
a field called cacheList inside java.util.ResourceBundle, however IBM
Implementation of this class doesn't have this field and it results in
failure.

I believe framework should not try to manipulate something like this while
performing operation on external object, where it doesn't have control and
feels wrong to me.  Besides my opinion,  I found on Internet that disabling
Struts dev mode, will make this problem disappear from the logs however it
would continue to happen and would be a performance hit as there is
exception floating and not being taken care correctly.

Has anyone found any solution to this, other than disabling Dev Mode? I
would be happy to assist in modifying this class so as it doesn;t blow but
would like to touch base with anyone from the Framework development team
who can give me some idea around the same.


*Thanks & Regards/ **सादर**,*
*Gaurav Daga*
*togauravd...@gmail.com <togauravd...@gmail.com> | +1.201.308.3242 | Web
Presence <http://goo.gl/lW0nh>  *
Do not follow where the path may lead. Go instead where there is no path
and leave a trail. - Harold R. McAlindon

Reply via email to