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

Inconsistent way to locate filename when creating configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.3
    • None
    • None
    • 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. 216-1.patch
          13 kB
          Gabriele Garuglieri
        2. resources.jar
          3 kB
          Gabriele Garuglieri

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: