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

Inconsistent way to locate filename when creating configuration

    XMLWordPrintableJSON

    Details

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

      commons-configuration-1.3-dev

      Description

      There is a different behaviour locating the configuration file in classpath depending on the way it is set in the configuration class.
      For example assuming "conf/conf1.properties" exists in classpath:

      PropertiesConfiguration pc = new PropertiesConfiguration("conf/conf1.properties");
      gives org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source conf1.properties

      while

      PropertiesConfiguration pc = new PropertiesConfiguration();
      pc.setFileName("conf/conf1.properties");
      pc.load();

      properly locate file in classpath and loads it.

        Attachments

        1. resources.jar
          3 kB
          Gabriele Garuglieri
        2. 216-1.patch
          13 kB
          Gabriele Garuglieri

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              garu Gabriele Garuglieri
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: