You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2011/01/07 06:37:45 UTC

[jira] Created: (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Calling update() on a newly created factory configuration causes FileNotFoundException
--------------------------------------------------------------------------------------

                 Key: FELIX-2766
                 URL: https://issues.apache.org/jira/browse/FELIX-2766
             Project: Felix
          Issue Type: Bug
    Affects Versions:  configadmin-1.2.8
            Reporter: Felix Meschberger
             Fix For: configadmin-1.2.10


The following code throws java.io.FileNotFoundException

  Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
  config.update();

because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.

According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.

[1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

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


[jira] Updated: (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Hall updated FELIX-2766:
-----------------------------

    Attachment: felix-2766.diff

Attaching patch to have the config loading method not try to load a config file when it doesn't exist but return an empty Dictionary (Hashtable).

> Calling update() on a newly created factory configuration causes FileNotFoundException
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2766
>                 URL: https://issues.apache.org/jira/browse/FELIX-2766
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions:  configadmin-1.2.8
>            Reporter: Felix Meschberger
>             Fix For: configadmin-1.2.10
>
>         Attachments: felix-2766.diff
>
>
> The following code throws java.io.FileNotFoundException
>   Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
>   config.update();
> because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.
> According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.
> [1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

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


[jira] Commented: (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Posted by "Carl Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982828#action_12982828 ] 

Carl Hall commented on FELIX-2766:
----------------------------------

I'm working on a patch for this that I should have available in the next couple of days.

> Calling update() on a newly created factory configuration causes FileNotFoundException
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2766
>                 URL: https://issues.apache.org/jira/browse/FELIX-2766
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions:  configadmin-1.2.8
>            Reporter: Felix Meschberger
>             Fix For: configadmin-1.2.10
>
>
> The following code throws java.io.FileNotFoundException
>   Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
>   config.update();
> because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.
> According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.
> [1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

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


[jira] Resolved: (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-2766.
--------------------------------------

    Resolution: Fixed
      Assignee: Felix Meschberger

I chose a slightly different approach in that I check for the existence of configuration in the update() method itself and only read if so.

In addition the UpdateTask has a bug with respect to updating newly created configurations: When updating ManagedServiceFactory services nothing is done; when updating ManagedService services a NullPointerException is thrown because there is no guard against no dictionary (as is the case for newly created configurations. To fix this, the UpdateTask assumes an empty dictionary for newly created configurations whose getProperties() method returns null

Fixed in Rev. 1067270

> Calling update() on a newly created factory configuration causes FileNotFoundException
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2766
>                 URL: https://issues.apache.org/jira/browse/FELIX-2766
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions:  configadmin-1.2.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: configadmin-1.2.10
>
>         Attachments: felix-2766.diff
>
>
> The following code throws java.io.FileNotFoundException
>   Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
>   config.update();
> because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.
> According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.
> [1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983547#action_12983547 ] 

Felix Meschberger commented on FELIX-2766:
------------------------------------------

Thanks for providing the patch. I will look into it asap.

> Calling update() on a newly created factory configuration causes FileNotFoundException
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2766
>                 URL: https://issues.apache.org/jira/browse/FELIX-2766
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions:  configadmin-1.2.8
>            Reporter: Felix Meschberger
>             Fix For: configadmin-1.2.10
>
>         Attachments: felix-2766.diff
>
>
> The following code throws java.io.FileNotFoundException
>   Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
>   config.update();
> because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.
> According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.
> [1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

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


[jira] [Updated] (FELIX-2766) Calling update() on a newly created factory configuration causes FileNotFoundException

Posted by "Felix Meschberger (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-2766:
-------------------------------------

    Fix Version/s:     (was: configadmin-1.2.10)
                   configadmin-1.4.0
    
> Calling update() on a newly created factory configuration causes FileNotFoundException
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-2766
>                 URL: https://issues.apache.org/jira/browse/FELIX-2766
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions:  configadmin-1.2.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: configadmin-1.4.0
>
>         Attachments: felix-2766.diff
>
>
> The following code throws java.io.FileNotFoundException
>   Configuration config = configurationAdmin.createFactoryConfiguration(name, null);
>   config.update();
> because the Configuration is newly created and has never been persisted, but the update() method tries to read the persistence file.
> According to a comment by Peter Kriens on the OSGi Dev List [1], the update() method should in this case just assume an empty dictionary and push this past the configuration plugins into the ManagedServiceFactory service.
> [1] http://www.mail-archive.com/osgi-dev@mail.osgi.org/msg01773.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira