commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Eichst├Ądt-Engelen" <>
Subject [configuration] Overriden Properties in CombinedConfiguration and the configuratinAt method
Date Fri, 26 Jan 2007 12:13:39 GMT

i am using commons-configuration with constantly growing enthusiasm. Thank you for this great

Now my question:

I am using CombinedConfiguration to make use of the Property overriding mechanism. My configuration-definition.xml
looks like this:

      <nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
      <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
    <system />
    <xml fileName="${OPERATIONS_CONFIGURATION}" throwExceptionOnMissing="true"
      config-name="operationsConfiguration" config-optional="false">
      <reloadingStrategy refreshDelay="1000"
    <xml fileName="messageComposerConfiguration.xml" throwExceptionOnMissing="true"
      config-name="messageComposer" config-at="messageComposer" config-optional="false">
      <reloadingStrategy refreshDelay="1000"
    [... more xmlConfigurations ...]

operationsConfiguration is intended to be a smaller (and more handy) configuration available
outside the archives (jars) containing only the relevant operational properties. It overrides
some values of the other xmlConfigurations of the e.g. backend libraries. So far so good ...
now i would like to use the BeanCreation mechanism furthermore. To provide data for those
beans i use the configurationAt(key) method to get a unique subtree containing all relevant

And here is my problem:

Using the configurationAt(key) throws an IllegalArgumentException because the given key is
ambiguous. That is correct because it is overriden and added twice hence. It tried the workaround
to create a combined node via getRootNode(). It worked but in this case all the e.g. configured
ReloadingStratety disappears because i had to create a new XmlConfiguration.

Would it make sense to overload the configurationAt method in CombinedConfiguration to support
such a behaviour? Or (and that could be really possible) didn't i understand the concept of
the CombinedConfiguration exactly.

Kind regards,

Thomas E.-E.

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

View raw message