[
https://issues.apache.org/jira/browse/FELIX-6069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879206#comment-17879206
]
Christoph Läubrich commented on FELIX-6069:
-------------------------------------------
I now created https://issues.apache.org/jira/browse/FELIX-6724 to specifically
track this (simpler) issue as it is obviously wrong reported here. I suspect
that this issue is also caused by a similar behavior but thats much harder to
analyze and address.
> SCR detects cyclic dependency for dynamically bound service
> -----------------------------------------------------------
>
> Key: FELIX-6069
> URL: https://issues.apache.org/jira/browse/FELIX-6069
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR)
> Affects Versions: scr-2.1.14
> Reporter: Andreas Lemmer
> Priority: Major
> Labels: cyclic, scr
>
> Problem case: A bundle with two components: Component1 binds Component2
> statically, Component2 binds Component1 dynamically. Both components have
> immediate=true (but changing that also doesn't help).
> When starting the bundle, there is (nearly always) a Framework error message
> from SCR:
> {{ERROR [org.apache.felix.scr] bundle org.apache.felix.scr:2.1.14
> (12)Circular reference detected trying to get service [Component1]}}
> {{stack of references: ServiceReference: [Component1]}}
> {{ServiceReference: [Component2]}}
> {{java.lang.Exception: stack trace}}
> {{at
> org.apache.felix.scr.impl.ComponentRegistry.enterCreate(ComponentRegistry.java:485)}}
> {{at
> org.apache.felix.scr.impl.BundleComponentActivator.enterCreate(BundleComponentActivator.java:735)}}
> {{at
> org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:882)}}
> SCR tries it again a few milliseconds later *which works*.
> The real problem here is the error logging indicating that something is not
> working. This is very disturbing, because the behavior changes from time to
> time which makes it very hard to see if something is really wrong or if it's
> just a temporary problem.
> In my opinion, SCR should first start Component2 without Component1, then
> start Component1 and then bind Component1 to Component2.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)