Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 72988 invoked from network); 16 Sep 2009 19:49:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 19:49:28 -0000 Received: (qmail 32682 invoked by uid 500); 16 Sep 2009 19:49:26 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 32478 invoked by uid 500); 16 Sep 2009 19:49:26 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 32467 invoked by uid 99); 16 Sep 2009 19:49:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 19:49:26 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.17.10] (HELO moutng.kundenserver.de) (212.227.17.10) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 19:49:14 +0000 Received: from [192.168.178.20] (trir-5d80363b.pool.mediaWays.net [93.128.54.59]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MKt2u-1Mo0Uo0d6h-000Fk9; Wed, 16 Sep 2009 21:48:54 +0200 Message-ID: <4AB14124.4080702@oliver-heger.de> Date: Wed, 16 Sep 2009 21:48:52 +0200 From: Oliver Heger User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Commons Users List Subject: Re: [CONFIGURATION] Help with optional XML file in override section of configuration builder. References: <99e30fe50909140530v679e8cd9jfe7d744f02346f32@mail.gmail.com> <4AAE9B85.3040001@oliver-heger.de> <99e30fe50909150134t1843f2a1q6c80326ffff4709@mail.gmail.com> <4AAFE2CB.1000006@oliver-heger.de> <99e30fe50909160437x4e6c455fodbdac0d16a8b881b@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1/1lKGrr679PiCV9ngYwOYmQypdNJtAYb1PR2u 5JizEjHetZDL+N20U3UJpbAZZBBQIFqy63+pRt2h+U/SHYSMrb 3Ge614CLJHJqkhtp/O3jQ== X-Virus-Checked: Checked by ClamAV on apache.org Ralph Goers schrieb: > > On Sep 16, 2009, at 4:37 AM, Martin Ritchie wrote: > >> >> Oliver, >> Thanks for the pointer to use DefaultConfigurationBuilder. >> >> Whilst this now does not need to have the test.config property defined >> or the file existing it does behave differently to the older >> ConfigurationFactory. >> >> With the configuration as shown in the pastie >> (http://pastie.org/617143) the ConfigurationFactory builds a single >> configuration tree where later elements are overwritten by newer >> values. >> So given the configuration values shown here: http://pastie.org/618625 >> The value of tests.store.class in config.xml (MemoryMessageStore) is >> overwritten with (SlowMessageStore) from the test.config. The >> additional values in the test.config are also propgated in to the >> final configuraiton. >> >> When I changed to use the DefaultConfigurationBuilder the entire >> virtualhosts section was overwritten as a result the other virtualhost >> sections in config.xml were lost. >> >> Is there a way I can get the behaviour as seen with the >> ConfigurationFactory but have the file parsing/loading of the >> DefaultConfigurationBuilder? >> > What you are experiencing is probably a result of the NodeCombiner being > used. In trunk you will find a "MergeCombiner" that may behave the way > you want it to. If you build trunk you should look at the updated > documentation as it provides some documentation on how the 3 combiners > work and what results they will produce in various situations. > > Ralph > The problem may also be related to the handling of list nodes. [1] contains a discussion about NodeCombiners used when constructing a combined configuration (which is done under the hood by DefaultConfigurationBuilder). It also mentions possible problems when dealing with list structures. In the description of the configuration definition file for DefaultConfigurationBuilder [2] it is explained how list nodes can be specified. Oliver [1] http://commons.apache.org/configuration/userguide/howto_combinedconfiguration.html#Node%20combiners [2] http://commons.apache.org/configuration/userguide/howto_configurationbuilder.html#Enhancements_of_the_configuration_definition_file --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org