commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut Bolčina <...@najdi.si>
Subject Re: [Configuration] XMLConfiguration reloading strategy
Date Sun, 23 Oct 2005 17:47:03 GMT
Oliver Heger wrote:

> Borut Bolčina wrote:
>
>> Hi, this is my first posting here.
>>
>> I wanted to use Commons Configuration to simplify configuration 
>> management in my web app. XMLConfiguration isn't reloading if file 
>> changes. Is this by design or is a bug? Normal properties reloading 
>> works as expected (setReloadingStrategy). This is my test method:
>>
>> private void run() {
>>        try {
>>            XMLConfiguration config = new 
>> XMLConfiguration("Database.xml");
>>            config.setReloadingStrategy(new 
>> FileChangedReloadingStrategy());
>>            String s = "tables.table(0).name";
>>                      PropertiesConfiguration config2 = new 
>> PropertiesConfiguration("usergui.properties");
>>            config2.setReloadingStrategy(new 
>> FileChangedReloadingStrategy());
>>            String s2 = "user.name";
>>                          for (;;) {
>>                System.out.println("xml :" + config.getString(s));
>>                System.out.println("prop:" + config2.getString(s2));
>>                try {
>>                    Thread.sleep(5 * 1000);
>>                } catch (InterruptedException e) {
>>                    e.printStackTrace();
>>                }
>>            }
>>        } catch (ConfigurationException e) {
>>            e.printStackTrace();
>>        }
>>    }
>>
>> Regards,
>> Borut
>
>
> Borut,
>
> in commons-configuration 1.1 final there was a bug related to 
> XMLConfiguration and its reloading strategy. Further information can 
> be found here:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=35118
>
> This bug has been fixed in svn. So you should try the newest version.
>
> Oliver
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
Oliver thanks,

I built the latest sources and it works! Now I can get down to business.

Regards,
Borut

---------------------------------------------------------------------
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