[ 
https://issues.apache.org/jira/browse/CONFIGURATION-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484840
 ] 

Oliver Heger commented on CONFIGURATION-259:
--------------------------------------------

You are right that the merging facilities provided by ConfigurationFactory are 
not as sophisticated as the ones supported by the newer 
DefaultConfigurationBuilder class. Because DefaultConfigurationBuilder is 
intended as a replacement for ConfigurationFactory my motivation for changing 
this is somewhat limited. (If somebody provided a patch, I would be happy to 
apply it of course.)

So would it be sufficient to add some notes to the documentation of 
ConfigurationFactory (in the JavaDocs and in the user guide) that describe 
these weakness and refer to DefaultConfigurationBuilder?

> ConfigurationFactory Merge is broken
> ------------------------------------
>
>                 Key: CONFIGURATION-259
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-259
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: Windows XP running Eclipse, JDK 1.4.2
>            Reporter: Karl Banke
>         Attachments: personendetails.xml, personensuche.xml, testconfig.xml, 
> TestConfiguration.java
>
>
> I am trying to merge two Configuration using the ConfigurationFactory and the 
> additional tag. It turns out that subsequent operations on the merged data 
> provide wrong results. In particular, after creating a particular subset from 
> a loaded configuration, the subset is empty. Strangely enough, when using 
> DefaultConfigurationBuilder to load exactly the same configurations this 
> works properly. 
> So when initializing the configuration as follows, I get the following error:
> URL configURL = getClass().getResource(configFile);
> ConfigurationFactory factory = new ConfigurationFactory();
> factory.setConfigurationURL(configURL);
> myConfig = factory.getConfiguration();
> 60043
> java.util.NoSuchElementException: 'HvNr' doesn't map to an existing object
>       at 
> org.apache.commons.configuration.AbstractConfiguration.getLong(AbstractConfiguration.java:743)
>       at 
> de.awd.vertriebsportal.portal.person.TestConfiguration.main(TestConfiguration.java:84)
> Exception in thread "main" 
> But when initializing it like this everything works properly
> DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
>             builder.setURL(configURL);
>             myConfig = builder.getConfiguration();
> 60043
> 54564
> I will attach full source code and xml files

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to