commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Hufgard <>
Subject Re[2]: [Configuration] FileChangedReloadingStrategy Not Working?
Date Wed, 27 Jul 2005 16:10:12 GMT
Hi Lukas,

as far as i remember, there are allready some bugs concerning this
problem in bugzilla. I had the same problem and solved it, by manually
calling config.setBasePath(String path) with the propertyfile's
basepath. Think there are also some other fixes in Bugzilla posted.


Wednesday, July 27, 2005, 5:58:13 PM, you wrote:

>> Is there anything in the following code block that would prevent the
>> FileChangedReloadingStrategy from functioning correctly?  It is declared
>>  just after member variables within the class itself.  The properties
>> load correctly utilizing getString(), getFloat(), etc.  However, they do
>> not reload after file changes and subsequent requests.

> I don't think the following (from the Commons Configuration Properties
> files documentation) would ever work with version 1.1:

>     PropertiesConfiguration config = new 
> PropertiesConfiguration("");
>     config.setReloadingStrategy(new FileChangedReloadingStrategy());

> It appears that properties files loaded using String filename 
> constructor of PropertiesConfiguration (assumed to be resources in the
> classpath) are verfied using a relative path from the working directory
> within FileChangedReloadingStrategy.hasChanged().  Unless your resources
> are stored in your working directory, it probably won't find them.

> Please add the following code to line 111 in the hasChanged() method of
>   FileChangedReloadingStrategy for more information.
> org.apache.commons.logging.LogFactory.getLog(FileChangedReloadingStrategy.class).debug("file
> doesn't exist " + configuration.getFile().getAbsolutePath()) ;

> FYI -- I'm storing my Properties files within 
> tomcat/webapps/ROOT/WEB-INF/classes.  They are loading correctly, but
> not re-loading at all.

> Please let me know if *I'm* doing something wrong, or have misunderstood
> how to utilize this functionality.  If I don't hear anything in the next
> 6 hours or so, I'll add an item to Bugzilla.

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

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

View raw message