[
https://issues.apache.org/jira/browse/CONFIGURATION-406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14047229#comment-14047229
]
Oliver Heger commented on CONFIGURATION-406:
--------------------------------------------
First of all, sorry that it took so long to comment on this issue!
>From looking at the source code of {{MultiFileHierarchicalConfiguration}} an
>{{XMLConfiguration}} instance with overloaded {{load()}} and {{save()}}
>methods is only returned if the variables in the pattern string cannot be
>resolved. In the fragment you provided it looks like you want to access a
>system property (the prefix _sys_ is used). However, the name of the property
>is not specified. Therefore, a property key named _sys_ is searched which
>obviously cannot be found.
Please re-check.
BTW, currently work on Commons Configuration 2.0 is going on. Here there are
some major changes in the way multi-file configurations are handled.
> Multi-tenant Configurations Sample is not working
> -------------------------------------------------
>
> Key: CONFIGURATION-406
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-406
> Project: Commons Configuration
> Issue Type: Bug
> Affects Versions: 1.6
> Environment: Win32;JDK1.6.0_17;SPRING-3.0.0.RELEASE
> Reporter: Joao Paulo Santos
>
> Using a SPRING config like this:
> {quote}
> <bean id="configurationFactory"
> class="org.apache.commons.configuration.DefaultConfigurationBuilder" >
> <constructor-arg>
> <value>configuration.xml</value>
> </constructor-arg>
> </bean>
>
> <bean id="config" factory-bean="configurationFactory"
> factory-method="getConfiguration" />
> {quote}
> and a the configuration.xml is:
> {quote}
> <configuration>
> <system />
> <header>
> <result delimiterParsingDisabled="true" forceReloadCheck="true"
>
> config-class="org.apache.commons.configuration.DynamicCombinedConfiguration"
> keyPattern="${sys:Id}">
> </result>
> <providers>
> <provider config-tag="multifile"
>
> config-class="org.apache.commons.configuration.DefaultConfigurationBuilder$FileConfigurationProvider"
>
> configurationClass="org.apache.commons.configuration.MultiFileHierarchicalConfiguration"/>
> </providers>
> </header>
> <override>
> <multifile filePattern="conf/${sys:Id}/test.xml"
> config-name="clientConfig"/>
> </override>
> </configuration>
> {quote}
> invoking to config.getString("any") always return null.
> Debuging I found that at MultiFileHierarchicalConfiguration in
> getConfiguration() when a new XMLConfiguration was created as an Inner class.
> The load() method has been overloded to an empty one. That was preventing the
> configuration to read the file.
>
>
--
This message was sent by Atlassian JIRA
(v6.2#6252)