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 B9D97D878 for ; Fri, 16 Nov 2012 06:40:15 +0000 (UTC) Received: (qmail 21388 invoked by uid 500); 16 Nov 2012 06:40:15 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 20978 invoked by uid 500); 16 Nov 2012 06:40:14 -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 20925 invoked by uid 99); 16 Nov 2012 06:40:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2012 06:40:12 +0000 Date: Fri, 16 Nov 2012 06:40:12 +0000 (UTC) From: "Felix Meschberger (JIRA)" To: dev@felix.apache.org Message-ID: <371786734.122838.1353048012882.JavaMail.jiratomcat@arcas> In-Reply-To: <1293510680.110883.1352849053814.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound 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-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498638#comment-13498638 ] Felix Meschberger commented on FELIX-3754: ------------------------------------------ Thanks for the feedback. I have aapplied the patch in Rev. 1410211 > Services registered from within the activate method may not be bound > -------------------------------------------------------------------- > > Key: FELIX-3754 > URL: https://issues.apache.org/jira/browse/FELIX-3754 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Affects Versions: scr-1.6.2 > Reporter: Felix Meschberger > Assignee: Felix Meschberger > Fix For: scr-1.6.4 > > Attachments: FELIX-3754-improved.patch > > > The Sling POST Servlet registers a number of services in the activate method and expects these services to be bound to itself. With SCR 1.6.0 this worked because each component instance had its dependency managers configured with its component instance. > As of SCR 1.6.2 the DependencyManager instances are shared amongst all component instances and thus don't have a reference to the component instances. Instead actually bind, unbind and update services the DependencyManager instances call the respective component manager which then dispatches to the component instances. > At the point in time when the activate method is called (in the ImmediateComponentManager.createComponentInstance method) the actual component instance is not "registered" with the component manager yet and thus a bind call while the activate method is called cannot be satisfied. > To fix this, the component instance must be "registered" with the component manager before calling the activate method. If the activate method fails, the instance must of course be "unregistered" again. -- 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