Property file uploaded

I have a Struts 2 web application running on Tomcat 7 on Windows Server 2008 (only Tomcat, without Apache or IIS). The texts in the application are stored in .properties files and are managed by the Struts 2 I18N Interceptor. In JSP, I use the <s:text name="menu.help" /> tags.
Several times (twice in the last month), the application loses links to property files because they have been unloaded, and instead it starts to display keys. For example, for English, "Help" is always displayed, but when I get this problem, it starts showing "menu.help". I have to restart the application for it to work properly again.
I searched for related errors in the logs, but could not find anything related to I18n or properties. I also searched for OutOfMemoryError , but could not find any.
Do you know what could be the problem? Can you think how I can fix it?
Thanks

Edit:
This is an important part of my struts.xml:

 <struts> <constant name="struts.custom.i18n.resources" value="resources" /> ... 

And the properties files (resources_en.properties, resources_es.properties, ...) are in the WEB-INF/classes .

+4
source share
2 answers

I think you need the default properties: resources.properties

Of course, this time you get the keys instead of translations, because the locale is not set by default.

0
source

If this is a memory issue, I suggest you do the following:

  • Minimize the size of the properties file, see if this solves the problem. Therefore, first minimize the size, perform a load check and see the result.
  • Separate it into different property files to make sure that this happens to all of them, or only to some of them.

This is my personal experience:

Sometimes the JVM (by mistake) garbage collects an object when it is not in use for a while. I have the same issue with JDK 4 and the oracle 9ac application server. JVM garbage collected a database connection when site load fell. So, create a small jsp page (test.jsp), add <s:text name="menu.help" /> to it. Then write a small application that requests this page every 1 min.

0
source

Source: https://habr.com/ru/post/1469040/


All Articles