Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-259

ConfigurationFactory Merge is broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows XP running Eclipse, JDK 1.4.2

      Description

      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

        Attachments

        1. personendetails.xml
          0.6 kB
          Karl Banke
        2. personensuche.xml
          0.6 kB
          Karl Banke
        3. testconfig.xml
          0.3 kB
          Karl Banke
        4. TestConfiguration.java
          3 kB
          Karl Banke

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              karlbanke Karl Banke
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: