[ 
https://issues.apache.org/jira/browse/CONFIGURATION-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14067982#comment-14067982
 ] 

Oliver Heger commented on CONFIGURATION-585:
--------------------------------------------

Still not sure if I understand what you mean by 'hard-coded'. Do you mean it is 
hard-coded into {{XMLConfiguration}} that it reads XML documents? Well, this is 
true, and this is indeed the sole purpose of this class. If you want to read 
other configuration sources, you can use other specialized classes like 
{{PropertiesConfiguration}} or {{DatabaseConfiguration}}. This is explained in 
the user's guide: 
http://commons.apache.org/proper/commons-configuration/userguide/overview.html#Using_Configuration

So is this actually a request for a kind of auto-detection of the configuration 
format?

What failing tests are you referring to? Trunk has about ~2500 unit tests, and 
they all run successfully.

> Hardcoded Parameters prevents correct initialisation of XML DocumentBuilder
> ---------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-585
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-585
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: File reloading
>    Affects Versions: 1.8
>         Environment: JDK 1.7.0.45
> MvN 3.0.5
>            Reporter: Martin Gainty
>            Priority: Blocker
>              Labels: XMLConfiguration
>             Fix For: 2.0
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> XMLConfiguration:
>  protected DocumentBuilder createDocumentBuilder()
>             throws ParserConfigurationException
>     {
>         if (getDocumentBuilder() != null)
>         {
>             return getDocumentBuilder();
>         }
>         else
>         {
>             DocumentBuilderFactory factory = DocumentBuilderFactory
>                     .newInstance();
>             if (isValidating())
>             {
>                 factory.setValidating(true);
>                 if (isSchemaValidation())
>                 {
>                     factory.setNamespaceAware(true);
>                     factory.setAttribute(JAXP_SCHEMA_LANGUAGE, 
> W3C_XML_SCHEMA);
>                 }
>             }
>             DocumentBuilder result = factory.newDocumentBuilder();
>             result.setEntityResolver(this.entityResolver);
>             if (isValidating())
>             {
>                 // register an error handler which detects validation errors
>                 result.setErrorHandler(new DefaultHandler()
>                 {
>                     @Override
>                     public void error(SAXParseException ex) throws 
> SAXException
>                     {
>                         throw ex;
>                     }
>                 });
>             }
>             return result;
>         }
>     }
> There is no way to externally set any of these parameters
> I propose 2 changes
> 1)read properties from pom.xml
> 2)morph this into a XMLConfigurationPlugin which will run goal to set the 
> params from configuration for new commons-configuration-plugin
> (Bug originally reported by Ron DiFrango from CapitalOne)
> Martin Gainty
> 11 July 2014



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to