struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heikki Hyyrö <>
Subject Problem reading a resource file (migrating 2.3.29 --> 2.5.10)
Date Fri, 10 Mar 2017 23:21:28 GMT

I decided to migrate a Struts-based application from Struts 2.3.x to 
2.5.x. The application worked without problems with Struts version 
2.3.29. After updating to 2.5.10, the application no longer seems to be 
able to read a root-level resource file "": calling 
getText("") results in an exception.

Since this problem did not happen with 2.3.29, I wonder if the 2.5.x 
versions have introduced a fundamental change in how the resource files 
are handled? I was not able to find such information in the 2.3 --> 2.5 
migration guide.

The problem occurs in the constructor of a database connection manager 
class that tries to retrieve database information (driver information, 
database url, and so on) from A rough sketch of the 
class is something like:

public class DbConnectionManager extends ActionSupport
   private DbConnectionManager()
     String driverNames = getText("database.drivers");  // This throws 
an exception in 2.5.10, but was ok in 2.3.29.

I suppose this problem could have something to do with the fact that 
this is a singleton class that is initialized only once during the 
lifetime of the application? If this is the case, then what would a 
simple way to fix the problem? A related question would be: how should I 
access resource files from a non-action context (e.g. read resources in 
static initialization), if ActionSupport no longer permits it?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message