commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [Commons Configuratin]: Suppress exceptions about missing optional property files?
Date Sat, 12 Apr 2008 14:32:33 GMT
uma_rk@comcast.net wrote:
> ConfigurationBuilder yields CombinedConfiguration.
> I have so far based my stuff on CompositeConfiguration.
> I do not see a type relationship (is-a) between the two.
> How do we migrate from CompositeConfiguration to
> CombinedConfiguration?
> 
> What are the risks?
> 
> Regards
> 
> /Ur

The APIs of CombinedConfiguration and CompositeConfiguration are pretty
similar, so a migration should not be too problematic.

The differences between the DefaultConfigurationBuilder and the
ConfigurationFactory approach are described in a section [1] of our user
guide.

Oliver

[1]
http://commons.apache.org/configuration/userguide/howto_configurationbuilder.html


> 
>  -------------- Original message ----------------------
> From: Emmanuel Bourg <ebourg@apache.org>
> 
>>Try using ConfigurationBuilder instead of ConfigurationFactory, you 
>>shouldn't have this exception.
>>
>>Emmanuel Bourg
>>
>>
>>uma_rk@comcast.net a écrit :
>>
>>>I am using the latest commons config on JDK1.6. Is there a way
>>>to suppress exceptions pertaining to missing optional property files?
>>>
>>>Thanks,
>>>
>>>/Ur
>>>
>>>Configuration:
>>>        <properties fileName="/home/jdoe/my.properties" optional="true" />
>>>
>>>Exception:
>>>Caused by: org.apache.commons.configuration.ConfigurationException: Cannot 
>>
>>locate configuration source /home/jdoe/my.properties
>>
>>>        at 
>>
>>org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConf
>>iguration.java:215)
>>
>>>        at 
>>
>>org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConf
>>iguration.java:195)
>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>For additional commands, e-mail: user-help@commons.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message