Hi,

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

Now my question:

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

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

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 data.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to