DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=34289>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=34289 ------- Additional Comments From [EMAIL PROTECTED] 2005-04-05 04:56 ------- The latest example exposes another bug... If the fully qualified properties file name is specified: PropertiesConfiguration config= new PropertiesConfiguration ("d:/tmp/commons.properties"); and the ouput statement is: System.out.println((new Date()) + " : " + strategy.reloadingRequired() + " : " + config.getString("prop1")); The updated propery is not retrieved. It appears that strategy.reloadingRequired() sets a flag and the next property retrieval request does not actaully reload the file. Commenting out strategy.reloadingRequired() allows the updated property to be reloaded. When only the file name is suppled and the file is loaded from a location in the classpath, commenting out strategy.reloadingRequired() still does not cause the updated property to be reloaded, e.g.: PropertiesConfiguration config= new PropertiesConfiguration ("commons.properties"); The problem appears to be caused by the basePath member of AbstractFileConfiguration not getting set properly after the properties file URL is obtained from the classpath. I was able to correct the problem by modifying AbstractFileConfiguration.load(String) from: public void load(String fileName) throws ConfigurationException { try { URL url = ConfigurationUtils.locate(basePath, fileName); if (url == null) { throw new ConfigurationException("Cannot locate configuration source " + fileName); } load(url); } catch (ConfigurationException e) { throw e; } catch (Exception e) { throw new ConfigurationException(e.getMessage(), e); } } to: public void load(String fileName) throws ConfigurationException { try { URL url = ConfigurationUtils.locate(basePath, fileName); if (url == null) { throw new ConfigurationException("Cannot locate configuration source " + fileName); } if(null == basePath){ setFile(new File(url.getFile())); } load(url); } catch (ConfigurationException e) { throw e; } catch (Exception e) { throw new ConfigurationException(e.getMessage(), e); } } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
