You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Andre Doherty (JIRA)" <ji...@apache.org> on 2006/10/03 16:53:19 UTC

[jira] Created: (CONFIGURATION-229) config : load for a configuration node is called before parsing is complete : attributes ignored

config : load for a configuration node is called before parsing is complete : attributes ignored
------------------------------------------------------------------------------------------------

                 Key: CONFIGURATION-229
                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-229
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.2 Final
            Reporter: Andre Doherty


Hi there

i have noticed the following issue which appears to be a bug. (Tested on 1.3 however the version doesn't appear above)

createObject from FileConfigurationFactory(DigesterConfigurationFactory) set fileName and fires load of properties : 

public Object createObject(Attributes attributes) throws Exception
        {
            FileConfiguration conf = createConfiguration(attributes);
            conf.setBasePath(getBasePath());
            conf.setFileName(attributes.getValue(ATTR_FILENAME));
            try
            {
                log.info("Trying to load configuration " + conf.getFileName());
                conf.load();
            }

However digester invokes createObject when the object is instancied and before setting any attributes. 

All other attributes beside fileName and basePath are not read in time and therefore are ignored during load.

I guess load should be called when node initialization is complete, possibly using a proper digester rule. 

Regards,
andré



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

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


[jira] Commented: (CONFIGURATION-229) config : load for a configuration node is called before parsing is complete : attributes ignored

Posted by "Andre Doherty (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CONFIGURATION-229?page=comments#action_12439573 ] 
            
Andre Doherty commented on CONFIGURATION-229:
---------------------------------------------


(Thank you for the DefaultConfigurationBuilder clue, i'll give it a try).

Yes for instance you might want to use that delimiterParsingDisabled attribute to ask the configuration not to parse properties items as : 

<configuration>
	<properties delimiterParsingDisabled="true" fileName="userprefs.properties" optional="true"/>
</configuration>

In this case, both delimiterParsingDisabled and optional attributes are ignored at load time.






> config : load for a configuration node is called before parsing is complete : attributes ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-229
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-229
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.3 Final
>            Reporter: Andre Doherty
>            Priority: Minor
>
> Hi there
> i have noticed the following issue which appears to be a bug. (Tested on 1.3 however the version doesn't appear above)
> createObject from FileConfigurationFactory(DigesterConfigurationFactory) set fileName and fires load of properties : 
> public Object createObject(Attributes attributes) throws Exception
>         {
>             FileConfiguration conf = createConfiguration(attributes);
>             conf.setBasePath(getBasePath());
>             conf.setFileName(attributes.getValue(ATTR_FILENAME));
>             try
>             {
>                 log.info("Trying to load configuration " + conf.getFileName());
>                 conf.load();
>             }
> However digester invokes createObject when the object is instancied and before setting any attributes. 
> All other attributes beside fileName and basePath are not read in time and therefore are ignored during load.
> I guess load should be called when node initialization is complete, possibly using a proper digester rule. 
> Regards,
> andré

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

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


[jira] Resolved: (CONFIGURATION-229) config : load for a configuration node is called before parsing is complete : attributes ignored

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CONFIGURATION-229?page=all ]

Oliver Heger resolved CONFIGURATION-229.
----------------------------------------

    Fix Version/s: Nightly Builds
       Resolution: Fixed

A fix was committed that causes the load() method to be invoked after initialization of all specified properties is completed. This should solve this problem. Please double-check.

Thanks!

> config : load for a configuration node is called before parsing is complete : attributes ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-229
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-229
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.3 Final
>            Reporter: Andre Doherty
>         Assigned To: Oliver Heger
>            Priority: Minor
>             Fix For: Nightly Builds
>
>
> Hi there
> i have noticed the following issue which appears to be a bug. (Tested on 1.3 however the version doesn't appear above)
> createObject from FileConfigurationFactory(DigesterConfigurationFactory) set fileName and fires load of properties : 
> public Object createObject(Attributes attributes) throws Exception
>         {
>             FileConfiguration conf = createConfiguration(attributes);
>             conf.setBasePath(getBasePath());
>             conf.setFileName(attributes.getValue(ATTR_FILENAME));
>             try
>             {
>                 log.info("Trying to load configuration " + conf.getFileName());
>                 conf.load();
>             }
> However digester invokes createObject when the object is instancied and before setting any attributes. 
> All other attributes beside fileName and basePath are not read in time and therefore are ignored during load.
> I guess load should be called when node initialization is complete, possibly using a proper digester rule. 
> Regards,
> andré

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

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


[jira] Updated: (CONFIGURATION-229) config : load for a configuration node is called before parsing is complete : attributes ignored

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CONFIGURATION-229?page=all ]

Oliver Heger updated CONFIGURATION-229:
---------------------------------------

    Affects Version/s: 1.3 Final
                           (was: 1.2 Final)
             Priority: Minor  (was: Major)

You are right. This is the behavior since the first release. Do you have a concrete use case why this does not work for you?

In 1.3 there is the new class DefaultConfigurationBuilder, which is able to interprete the same configuration definition files as ConfigurationFactory. This class does not use digester for parsing the XML files. It should set all properties before the load() method is called. Can you give it a try?

Thanks.

> config : load for a configuration node is called before parsing is complete : attributes ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-229
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-229
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.3 Final
>            Reporter: Andre Doherty
>            Priority: Minor
>
> Hi there
> i have noticed the following issue which appears to be a bug. (Tested on 1.3 however the version doesn't appear above)
> createObject from FileConfigurationFactory(DigesterConfigurationFactory) set fileName and fires load of properties : 
> public Object createObject(Attributes attributes) throws Exception
>         {
>             FileConfiguration conf = createConfiguration(attributes);
>             conf.setBasePath(getBasePath());
>             conf.setFileName(attributes.getValue(ATTR_FILENAME));
>             try
>             {
>                 log.info("Trying to load configuration " + conf.getFileName());
>                 conf.load();
>             }
> However digester invokes createObject when the object is instancied and before setting any attributes. 
> All other attributes beside fileName and basePath are not read in time and therefore are ignored during load.
> I guess load should be called when node initialization is complete, possibly using a proper digester rule. 
> Regards,
> andré

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

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