Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 91707 invoked from network); 28 Oct 2005 12:19:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Oct 2005 12:19:01 -0000 Received: (qmail 78982 invoked by uid 500); 28 Oct 2005 12:18:07 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 78834 invoked by uid 500); 28 Oct 2005 12:18:06 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 78774 invoked by uid 99); 28 Oct 2005 12:18:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Oct 2005 05:18:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of cory.lewis@genworth.com designates 12.39.204.28 as permitted sender) Received: from [12.39.204.28] (HELO genworth.com) (12.39.204.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Oct 2005 05:18:02 -0700 Received: from ([192.168.10.77]) by mx3.genworth.com with ESMTP id KP-RBZB4.34377063; Fri, 28 Oct 2005 08:17:27 -0400 Received: from xp01ric.genworth.net ([3.129.136.91]) by xp01ral.genworth.net with Microsoft SMTPSVC(6.0.3790.1830); Fri, 28 Oct 2005 08:17:27 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message Subject: RE: [configuration] PropertiesConfiguration include functionality broken Date: Fri, 28 Oct 2005 08:17:26 -0400 Message-ID: <329C4BACAB2F7644A0E05117BD4A86BD02BABAA4@xp01ric.genworth.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [configuration] PropertiesConfiguration include functionality broken Thread-Index: AcXbhHoU5N6ClFUVQHukGytk3he6aAAM01AA From: "Lewis, Cory \(Genworth\)" To: "Jakarta Commons Developers List" X-OriginalArrivalTime: 28 Oct 2005 12:17:27.0567 (UTC) FILETIME=[8FAA69F0:01C5DBB9] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >Lewis, Cory (Genworth) schrieb: >> Hi. >> >> I believe I've found a bug in commons-configuration 1.1. Basically, >> PropertiesConfiguration will not actually include files in an include >> directive until the original properties file has been reloaded. >> >> An example: >> >> [prefs.properties] >> include=other.properties >> foo=pref test1 >> >> [other.properties] >> bar=other test2 >> >> the test: >> >> PropertiesConfiguration config = new >> PropertiesConfiguration("prefs.properties"); >> config.setReloadingStrategy(new FileChangedReloadingStrategy()); >> >> int current = 0; >> >> while(current < 2){ >> System.out.println(config.getString("foo")); >> System.out.println(config.getString("bar")); >> current++; >> Thread.sleep(10000); >> } >> >> If this is run, and no files are touched, you'll get pref test1 null >> pref test1 null >> >> If, however, you make a change to prefs.properties so the file gets >> reread during the sleep, you'll get pref test1 null pref test1 other >> test2 >> >>> >> If you take out the reload strategy and run this against configuration >> 1.0, it works as expected. >> It may be noted that I have applied the patch supplied in bug 34289 by >> Oliver Heger. >> http://issues.apache.org/bugzilla/show_bug.cgi?id=34289 >> >> I'd be happy to file a bug report, but someone else who can be more >> concise may want to do it. >> >> In the meantime, if any one has a quick fix for this, it would be >> greatly appreciated. >> >> >Cory, > >from your comments I read that you do not use the current version of configuration (i.e. the version >in svn). In addition to the patch you mention there have been other changes to ProppertiesConfiguration. Some of them also affected the include mechanism. I remember one issue >with the base path not being correctly set, which makes including files fail. > >So, could you please give the current svn trunk a try and check if the problem persists? If this is >the case, I will have a look. > >Thanks. >Oliver Oliver, I did finally get the latest build, and it fixed the problem I describe above. I believe there's still an issue with PropertiesConfiguration(File), where if File(String) is only given the relative path(i.e. just the filename) and the file is in the classpath, it does not initially load it. It exhibits the same behavior as above; properties are not available until the file has changed and been reloaded. Not a serious issue, as it's easier to use PropertiesConfiguration(String) in this case, but perhaps an issue nonetheless. Thanks, Cory --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org