commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: [CONFIGURATION] Help with optional XML file in override section of configuration builder.
Date Wed, 16 Sep 2009 19:48:52 GMT
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
>> ( the ConfigurationFactory builds a single
>> configuration tree where later elements are overwritten by newer
>> values.
>> So given the configuration values shown here:
>> The value of 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 




To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message