You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "James Hanson (JIRA)" <ji...@apache.org> on 2009/05/19 15:14:45 UTC

[jira] Created: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
--------------------------------------------------------------------------------------------------------------------------------------------

                 Key: FELIX-1165
                 URL: https://issues.apache.org/jira/browse/FELIX-1165
             Project: Felix
          Issue Type: Bug
          Components: Configuration Admin
    Affects Versions: configadmin-1.0.10, configadmin-1.0.8, configadmin-1.0.4, configadmin-1.0.1
         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
            Reporter: James Hanson
            Priority: Minor


When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.

Test setup:

Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
Create a "configurator" bundle and send a configuration to the PID.
Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
Add the two new bundles to the felix.auto.start.1 property.
Start Felix.
Stop the "configurable" bundle, and start it again.

* If the configuration is sent from the "configurator", the bundle receives it.
* If felix is restarted, the problem disappears unless the felix-cache is deleted.

This can be reproduced with felix 1.8.0 using the example at:

http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service

See also bug FELIX-516.

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


[jira] Resolved: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

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

Felix Meschberger resolved FELIX-1165.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: configadmin-1.0.12

Thanks for tracking down this issue - this helped a lot.

And here is the actual way to reproduce the problem:

   * start a bundle registering a ManagedService
   * create and update configuration for the ManagedService
   * --> the ManagedService gets the configuration
   * stop the bundle unregistering the ManagedService (*)
   * start the bundle registering a ManagedService
  * --> the ManagedService does *not* get the configuration

the problem effectively is, that when the configuration is first handed to the ManagedService through the UpdateConfiguration task, the service reference field is not set. Thus the delivered flag is not rest on ManagedService unregistration. When the bundle is restarted and the ManagedService registered again, the ConfigurationAdmin falsely assumes the configuration has already been delivered.

This problem does not occurr if the configuration is created *before* the ManagedService is registered for the first time because then the ManagedServiceUpdate task is called which in fact sets the service reference field and thus on service unregistration, the delivered flag is reset as expected.

In Rev. 804387 I committed the fix along with a new integration test ensuring this behaviour.

Can you please verify and close this issue. Thanks.


> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: configadmin-1.0.12
>
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Commented: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

Posted by "James Hanson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716668#action_12716668 ] 

James Hanson commented on FELIX-1165:
-------------------------------------

When the configurator bundle sends the new configuration via Configuration.update(props), the update is processed by ConfigurationManager$UpdateConfiguration.run().  This method doesn't set the ConfigurationImpl.serviceReference.  When the configured bundle is stopped, the ConfigurationManager$AbstractManagedServiceTracker.removedService() method will not call ConfigurationImpl.setDelivered(false), because it first checks that the serviceReference being removed equals the ConfigurationImpl.serviceReference (which is null).

If the configuration is found by the PersistenceManager, the ConfigurationImpl.serviceReference is set in ConfigurationManager$ManagedServiceUpdate.run().

Suggested solution - set the ConfigurationImpl.serviceReference in ConfigurationManager$UpdateConfiguration.run().

> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Priority: Minor
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Closed: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

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

Felix Meschberger closed FELIX-1165.
------------------------------------


Close all issues now this version has been released

> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: configadmin-1.2.0
>
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Assigned: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

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

Felix Meschberger reassigned FELIX-1165:
----------------------------------------

    Assignee: Felix Meschberger

> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Assignee: Felix Meschberger
>            Priority: Minor
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Commented: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

Posted by "Thilo Planz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722940#action_12722940 ] 

Thilo Planz commented on FELIX-1165:
------------------------------------

I think I am running into the same problem, even without using felix.auto.start.

I have both bundles and configuration managed by Felix FileInstall 
(and I am using org.osgi.framework.storage.clean = onFirstInit to get a fresh bundle cache every time).

When a bundle gets updated, it does not receive configuration information.

I need to "touch" the configuration file to trigger configuration.

Could this be related to the weird bundle location that FileInstall sets 
(  /C:/bundles/org.osgi.compendium-1.2.0.jar without any protocol, so that the bundle cannot be updated the update shell command) ?

Please raise the priority to something more than "minor".


> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Priority: Minor
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Commented: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

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

Felix Meschberger commented on FELIX-1165:
------------------------------------------

Can you attach the source of your sample bundles to this issue, please ? Thanks.

The problem might be a subtle bug in your configurator bundle: This should use the ConfigurationAdmin.getConfiguration(String pid, String location) method and either set the location parameter to the actual bundle location of the configurable bundle or -- better yet, IMHO -- to null to not create a bound configuration at all.

> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Priority: Minor
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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


[jira] Updated: (FELIX-1165) When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.

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

James Hanson updated FELIX-1165:
--------------------------------

    Attachment: sample.zip

The key points are PropertiesConfigManager:61 in the configurator project, and ServletManager:37 and 79 in the configurable project.

> When restarting a bundle, the config admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1165
>                 URL: https://issues.apache.org/jira/browse/FELIX-1165
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.1, configadmin-1.0.4, configadmin-1.0.8, configadmin-1.0.10
>         Environment: Windows XP, JDK 1.6.0_10, Felix 1.8.0, configadmin 1.0.10
>            Reporter: James Hanson
>            Priority: Minor
>         Attachments: sample.zip
>
>
> When restarting a bundle, the configuration admin reports "Configuration ... has already been delivered", and the bundle receives no configuration.
> As far as I can tell this only occurs if a bundle is installed and started by the felix.auto.start.1 property in the config.properties.  If Felix is restarted and the bundle is loaded from the cache, the problem disappears.
> Test setup:
> Create a "configurable" bundle, implement ManagedService and register as a ManagedService with a PID from the BundleActivator start() method.
> Create a "configurator" bundle and send a configuration to the PID.
> Extract Felix and add the Felix config admin bundle to the felix.auto.start.1 property in conf/config.properties
> Add the two new bundles to the felix.auto.start.1 property.
> Start Felix.
> Stop the "configurable" bundle, and start it again.
> * If the configuration is sent from the "configurator", the bundle receives it.
> * If felix is restarted, the problem disappears unless the felix-cache is deleted.
> This can be reproduced with felix 1.8.0 using the example at:
> http://www.dynamicjava.org/articles/osgi-compendium/configuration-admin-service
> See also bug FELIX-516.

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