commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Bradley <lu...@somnia.com>
Subject Re: [Configuration] FileChangedReloadingStrategy Not Working?
Date Wed, 27 Jul 2005 15:58:13 GMT
> 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("usergui.properties");
    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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message