commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriele Garuglieri (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-216) Inconsistent way to locate filename when creating configuration
Date Tue, 22 Aug 2006 14:33:16 GMT
Gabriele Garuglieri commented on CONFIGURATION-216:

Hi Oliver,
i've found a condition in which the fix won't work.
Given this snippet of code:
DefaultConfigurationBuilder cf =  new DefaultConfigurationBuilder("conf/config/deep/testFileFromClasspath.xml");
 CombinedConfiguration config = cf.getConfiguration(true);

that loads this configuration file:
  <properties config-name="propConf" fileName=""/>

with "" located into "/conf" that is in classpath

will end up trying to load "conf/config/deep/" which is not found.

I've reworked a bit the code and produced a patch that should correct the problem.
You migth not agree on the code but at least it should give you the idea of the flaw in the
previous implementation.

> Inconsistent way to locate filename when creating configuration
> ---------------------------------------------------------------
>                 Key: CONFIGURATION-216
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>         Environment: commons-configuration-1.3-dev
>            Reporter: Gabriele Garuglieri
>         Assigned To: Oliver Heger
>            Priority: Minor
> 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/" exists in classpath:
> PropertiesConfiguration pc = new PropertiesConfiguration("conf/");
> gives org.apache.commons.configuration.ConfigurationException: Cannot locate configuration
> while
> PropertiesConfiguration pc = new PropertiesConfiguration();
> pc.setFileName("conf/");
> pc.load();
> properly locate file in classpath and loads it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message