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

config : load for a configuration node is called before parsing is complete : attributes ignored

    XMLWordPrintableJSON

    Details

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

      Description

      Hi there

      i have noticed the following issue which appears to be a bug. (Tested on 1.3 however the version doesn't appear above)

      createObject from FileConfigurationFactory(DigesterConfigurationFactory) set fileName and fires load of properties :

      public Object createObject(Attributes attributes) throws Exception
      {
      FileConfiguration conf = createConfiguration(attributes);
      conf.setBasePath(getBasePath());
      conf.setFileName(attributes.getValue(ATTR_FILENAME));
      try

      { log.info("Trying to load configuration " + conf.getFileName()); conf.load(); }

      However digester invokes createObject when the object is instancied and before setting any attributes.

      All other attributes beside fileName and basePath are not read in time and therefore are ignored during load.

      I guess load should be called when node initialization is complete, possibly using a proper digester rule.

      Regards,
      andré

        Attachments

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              andre.doherty@libertysurf.fr Andre Doherty
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: