commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CONFIGURATION-285) <configuration fileName="local-configuration.xml" config-optional="true" /> does not report parsing errors in local-configuration.xml
Date Sat, 21 Jul 2007 19:11:06 GMT

     [ https://issues.apache.org/jira/browse/CONFIGURATION-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oliver Heger resolved CONFIGURATION-285.
----------------------------------------

    Resolution: Fixed

DefaultConfigurationBuilder now fires an error event when loading of an optional configuration
source fails.

If I understand this request correctly, you want to distinguish between cases where an optional
configuration cannot be found and where it is present, but loading it causes an error. However
this is not possible: "Being present" is specific for file-based configurations, but an optional
configuration could be anything, e.g. a JNDI or database configuration. How could we decide,
based on the thrown exceptions, whether the current problem was caused by a non-available
configuration source or by a source that is available, but cannot be accessed because of an
internal error?

With the error listener mechanism you can hook into the process of loading the declared configuration
sources. If an error occurs, you are notified and can make this decision yourself based on
any criteria suitable for your concrete application and use case.

> <configuration fileName="local-configuration.xml" config-optional="true" /> does
not report parsing errors in local-configuration.xml
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-285
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-285
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Thorbjørn Ravn Andersen
>            Assignee: Oliver Heger
>             Fix For: 1.5
>
>
> I'm trying to build a configuration system to be shared between our Java applications.
 I therefore want to have optional configurations included from the main configuration file
read by DefaultConfigurationBuilder
> <configuration fileName="local-configuration.xml" config-optional="true" />
> I have found that if the sub-configuration file is invalid the error is silently ignored.
 The same without config-options="true" results in a ConfigurationException to be thrown (which
wraps a ConfigurationRuntimeException which wraps the ConfigurationException which wraps the
SAXException).
> I believe that the behaviour is incorrect.  The sub-configuration file should be skipped
if not found, but any errors found when parsing the existing file should be logged.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message