Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 251548E82 for ; Sun, 14 Aug 2011 20:34:54 +0000 (UTC) Received: (qmail 53766 invoked by uid 500); 14 Aug 2011 20:34:53 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 53675 invoked by uid 500); 14 Aug 2011 20:34:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 53667 invoked by uid 99); 14 Aug 2011 20:34:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Aug 2011 20:34:52 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Aug 2011 20:34:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E91DABCA05 for ; Sun, 14 Aug 2011 20:34:27 +0000 (UTC) Date: Sun, 14 Aug 2011 20:34:27 +0000 (UTC) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Message-ID: <7308426.37473.1313354067951.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2142743332.28898.1313085630347.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CONFIGURATION-460) reloadStrategy does not work for files inside tag using DefaultConfigurationBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CONFIGURATION-460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084900#comment-13084900 ] Oliver Heger commented on CONFIGURATION-460: -------------------------------------------- The problem is probably caused by the structure of the combined configuration produced by {{DefaultConfigurationBuilder}}: * There is one {{CombinedConfiguration}} which stores all properties. It is configured by properties in the _result_ section. * For configuration sources declared in the _additional_ section another {{CombinedConfiguration}} is created and added to the first {{CombinedConfiguration}}. This configuration, however, is currently not fully initialized. Especially the _forceReloadCheck_ property is not set. Therefore reloads are not detected. A fix for this issue has to ensure that some of the properties defined for the result configuration are also set for the configuration for the additional sources. > reloadStrategy does not work for files inside tag using DefaultConfigurationBuilder > ------------------------------------------------------------------------------------------------ > > Key: CONFIGURATION-460 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-460 > Project: Commons Configuration > Issue Type: Bug > Components: File reloading > Affects Versions: 1.6 > Environment: Linux x86_64 > Reporter: Azfar Kazmi > > In the configuration file that DefaultConfigurationBuilder reads to build a CombinedConfiguration, it's possible to include configuration file either inside or xml elements. > Each such declaration, of a file, allows a realodStrategy to be specified (see example below). It appears that the reload occurs only for the files inside and not for the ones inside . > Example: > >
> > > >
> > > config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/> > > > > > config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/> > > >
> In above example, both user.properties and application.properties are supposed to reload upon change. However, as tested by the following code, one user.properties gets reloaded: > DefaultConfigurationBuilder dcb = new DefaultConfigurationBuilder("example.xml"); > Configuration conf = dcb.getConfiguration(); > System.out.println("user: " + conf.getBoolean("user")); > System.out.println("application: " + conf.getBoolean("application")); > System.out.println("Change files and then press to continue..."); > System.in.read(); > > System.out.println("user: " + conf.getBoolean("user")); > System.out.println("application: " + conf.getBoolean("application")); > Output from above code: > user: true > application: true > Change files and then press to continue... > 0 [main] INFO org.apache.commons.configuration.PropertiesConfiguration - Reloading configuration. URL is file:/user.properties > user: false > application: true -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira