Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAB7FD0EA for ; Tue, 11 Sep 2012 23:22:07 +0000 (UTC) Received: (qmail 65589 invoked by uid 500); 11 Sep 2012 23:22:07 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 65539 invoked by uid 500); 11 Sep 2012 23:22:07 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 65528 invoked by uid 99); 11 Sep 2012 23:22:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2012 23:22:07 +0000 Date: Wed, 12 Sep 2012 10:22:07 +1100 (NCT) From: "David Jencks (JIRA)" To: dev@felix.apache.org Message-ID: <400252187.66510.1347405727501.JavaMail.jiratomcat@arcas> In-Reply-To: <2029227740.65741.1347399247868.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (FELIX-3661) Scr sometimes does not invoke Reference bind method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-3661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453540#comment-13453540 ] David Jencks commented on FELIX-3661: ------------------------------------- I see something about what is going on.... I think one thread has created the object and activated it but not yet set it as the instance object, but the state is no longer "unsatisfied". So the other thread can't find the object to bind to. I'm not sure how to fix this yet.... but I just started thinking :-) > Scr sometimes does not invoke Reference bind method > --------------------------------------------------- > > Key: FELIX-3661 > URL: https://issues.apache.org/jira/browse/FELIX-3661 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Reporter: Pierre De Rop > Assignee: David Jencks > Attachments: msg.log > > > With scr from trunk: sometimes, a satisfied Reference bind method is not invoked. > I'm not sure, but this might be related to the FELIX-3659 issue and/or when Reference types are org.osgi.service.ComponentFactory types. > The use case is the following: > - I have a DS component (name="agent"), which depends on the CompositeFactory service (ref is dynamic, optional, cardinality=0..N). > - the "agent" component is started (at this point), the CompositeFactory is not yet available > - next, the implementation bundle for the CompositeFactory service starts and registers the service, using bundleContext.registerService. > - but the "agent" component is not invoked in its bindCompositeFactory(CompositeFactory) method. > I have attached a logfile which illustrates the problem. > 1) Line 8491: the '"agent" component is being created, and some bind method are successfully invoked, except the "bindCompositeFactory" method (but this is normal since the service is optional, and not yet available): > 2012-09-11 23:09:21,147 ProxyAppReporter-FastCacheListener DEBUG osgi - [agent] For dependency loggerRepository, optional: false; to bind: {[org.apache.log4j.spi.LoggerRepository]=org.apache.felix.scr.impl.manager.AbstractComponentManager$RefPair@1b7a875} > 2012-09-11 23:09:21,147 ProxyAppReporter-FastCacheListener DEBUG osgi - [agent] invoking bind: bindLoggerRepository > 2012-09-11 23:09:21,147 ProxyAppReporter-FastCacheListener DEBUG osgi - [agent] For dependency compositeFactory, optional: true; to bind: {} > (here the bind for loggerRepository is invoked, but not for compositeFactory ... normal behavior for now. > 2) at line 8644, the CompositeFactory service is being registered, but we see the "component not yet created, assuming bind method call succeeded" log and the bindCompositeFactory method on the "agent" component is not invoked. > However, another "com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand" DS component is succesfully bound with the CompositeFactory, but this component depends on the CompositeService, using a ServiceReference type, instead of the actual CompositeFactory type, in the bind method signature ... > 2012-09-11 23:09:21,222 ProxyAppReporter-FastCacheListener WARN com.alcatel_lucent.as.service.composite.impl.CompositeFactoryImpl - Registering CompositeFactory ... > 2012-09-11 23:09:21,222 ProxyAppReporter-FastCacheListener DEBUG osgi - [agent] Dependency Manager: Adding Service com.alcatel_lucent.as.service.composite.CompositeFactory/565 > 2012-09-11 23:09:21,222 ProxyAppReporter-FastCacheListener DEBUG osgi - [agent] DependencyManager : component not yet created, assuming bind method call succeeded > 2012-09-11 23:09:21,223 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.GogoCompositeCommand] Dependency Manager: Adding Service com.alcatel_lucent.as.service.composite.CompositeFactory/565 > 2012-09-11 23:09:21,223 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.GogoCompositeCommand] DependencyManager : component not yet created, assuming bind method call succeeded > 2012-09-11 23:09:21,223 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] Dependency Manager: Adding Service com.alcatel_lucent.as.service.composite.CompositeFactory/565 > 2012-09-11 23:09:21,223 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] getting bind: bindCompositeFactory > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] Locating method bindCompositeFactory in class com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] doFindMethod: Looking for method com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand.bindCompositeFactory > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] doFindMethod: Found Method public void com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand.bindCompositeFactory(org.osgi.framework.ServiceReference) > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] Found bind method: public void com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand.bindCompositeFactory(org.osgi.framework.ServiceReference) > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener DEBUG osgi - [com.alcatel_lucent.as.service.composite.impl.shell.FelixCompositeCommand] invoking bind: bindCompositeFactory > 2012-09-11 23:09:21,224 ProxyAppReporter-FastCacheListener INFO osgi.event.service - Service registered by bundle com.alcatel_lucent.as.service.composite.impl(1.1100.01) > {objectClass=[com.alcatel_lucent.as.service.composite.CompositeFactory],service.id=565} > Hope that the log file will be enough to understand the issue ? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira