Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Issue with OSGi Config Admin, DS and component factory(After bundle restart factory instances don't become active again)
Issue with OSGi Config Admin, DS and component factory [message #1821647] Tue, 18 February 2020 07:53 Go to next message
Mike Rumpf is currently offline Mike RumpfFriend
Messages: 5
Registered: February 2020
Junior Member
Hi,

I encountered a problem with a factory component, Equinox CM ( 1.4.200.v20191001-1333) and a custom bundle with the following service component:

@Component(name = "ConfiguredComponent", service = {}, configurationPid = { "$", "mybase" },
        configurationPolicy = ConfigurationPolicy.REQUIRE)
public class ConfiguredComponent {}


If I provide 2 factory configurations via the ConfigAdmin and a configuration with the name "mybase" two instances of ConfiguredComponent are created. That works fine just as expected.

However if I stop and start the bundle containing the ConfiguredComponent, both instances are not re-created though all respective configurations are still active.

I found out that having "mybase" as additional configurationPid is responsible for the unexpected behaviour. If I remove the configurationPid definition from the component header restarting the bundle will also restart the two component instances as I would have expected.

Is this a cm bug with handling multiple configurations? Or is a factory component only allowed to have one configuration which will control the instance creation?

Thank in advance,
Mike

PS: If needed I could provide a complete example demonstrating the issue.
Re: Issue with OSGi Config Admin, DS and component factory [message #1821698 is a reply to message #1821647] Tue, 18 February 2020 19:59 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 502
Registered: July 2009
Senior Member
From your description it sounds like the configuration for "mybase" is not a factory configuration, but then the configurations for the class name "$" are two factory configurations? Is that true, so we actually have three configurations that match this component?

Or are you saying you only have two configurations, one a factory configuration using "$" and one using "mybase"?

Tom
Re: Issue with OSGi Config Admin, DS and component factory [message #1821727 is a reply to message #1821698] Wed, 19 February 2020 08:40 Go to previous messageGo to next message
Mike Rumpf is currently offline Mike RumpfFriend
Messages: 5
Registered: February 2020
Junior Member
The first case is true: "mybase" is not a factory configuration. So there are two factory configurations for "$" and one "standard" configuration.

I guess factory component should only have one factory configuration. But surprisingly initial startup is fine and only the bundle restart leads to the issue.
Re: Issue with OSGi Config Admin, DS and component factory [message #1821748 is a reply to message #1821727] Wed, 19 February 2020 13:30 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 502
Registered: July 2009
Senior Member
Right, I had to refresh my memory on how this works. So SCR (DS implementation) is supposed to merge the mybase config properties with the factory configuration from "$" which should result in two instances of your service component. It seems this is happening initially which indicates that SCR is receiving the configuration events correctly from config admin and applying them to the component instances. My guess is that SCR has some bug when a bundle is restarted and it needs to do this merge operation from a cached configuration state. If you open a bug with steps to reproduce we can have a look. If it is a Felix SCR issue then we can get an issue open with Felix once that is determined.
Previous Topic:Stuck progress bar while installing p2 artifacts
Next Topic:Using sp_redeploy in SSL enabled environment
Goto Forum:
  


Current Time: Thu Oct 06 07:42:36 GMT 2022

Powered by FUDForum. Page generated in 0.05748 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top