BJ Hargrave created FELIX-4585:
----------------------------------
Summary: SCR will create an additional component instance when
ComponentContext.enableComponent is called
Key: FELIX-4585
URL: https://issues.apache.org/jira/browse/FELIX-4585
Project: Felix
Issue Type: Bug
Components: Declarative Services (SCR)
Reporter: BJ Hargrave
In the OSGi CT, the
testActivateDeactivate(org.osgi.test.cases.component.junit.DeclarativeServicesControl)
method tests that that component activate and deactivate methods are properly
called. It uses ComponentContext.disableComponent and enableComponent to cause
component instances to be disposed and created.
If ComponentContext.enableComponent is called on an already enabled component,
SCR will improperly create an additional instance of the component.
See the following log messages:
org.osgi.test.cases.component.tb6.CcBcMapIntNS110@1048641931 activate
org.osgi.test.cases.component.tb6.ContExp@339127939 activate
configuration update org.osgi.test.cases.component.tb6.CcBcMapIntNS110
configuration updated org.osgi.test.cases.component.tb6.CcBcMapIntNS110
org.osgi.test.cases.component.tb6.CcBcMapIntNS110@1048641931 deactCcBcMapInt
org.osgi.test.cases.component.tb6.CcBcMapIntNS110@855459426 activate
enable org.osgi.test.cases.component.tb6.CcBcMapIntNS110
enabled org.osgi.test.cases.component.tb6.CcBcMapIntNS110
org.osgi.test.cases.component.tb6.CcBcMapIntNS110@232400695 activate
We can see that CcBcMapIntNS110 is activated initially. Then in response to a
configuration change, the component instance is deactivated and a new instance
it activated. Then ComponentContext.enableComponent is called on the already
enabled component and another instance is created in error.
This error is creating problems passing the OSGi CT.
--
This message was sent by Atlassian JIRA
(v6.2#6252)