You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2012/11/14 00:24:13 UTC

[jira] [Created] (FELIX-3754) Services registered from within the activate method may not be bound

Felix Meschberger created FELIX-3754:
----------------------------------------

             Summary: 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
             Fix For: scr-1.8.0


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

[jira] [Assigned] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned FELIX-3754:
----------------------------------------

    Assignee: Felix Meschberger
    
> 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.8.0
>
>
> 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

[jira] [Resolved] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-3754.
--------------------------------------

    Resolution: Fixed

Our testcases and the OSGi CT still pass, so this can be resolved.
                
> 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

[jira] [Resolved] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-3754.
--------------------------------------

    Resolution: Fixed

Fixed with a test case in Rev. 1409028.
                
> 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
>             Fix For: scr-1.8.0
>
>
> 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

[jira] [Reopened] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Jencks reopened FELIX-3754:
---------------------------------


Please convince me that this use case is spec compliant.
                
> 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.8.0
>
>
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496695#comment-13496695 ] 

David Jencks commented on FELIX-3754:
-------------------------------------

Doesn't this use case violate the spec?  A getService call cannot return an instance before it's activate method has returned.
                
> 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.8.0
>
>
> 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

[jira] [Comment Edited] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496916#comment-13496916 ] 

Felix Meschberger edited comment on FELIX-3754 at 11/14/12 7:28 AM:
--------------------------------------------------------------------

This is not about getService. This is what happens:

  Component references Service S (0..n, dynamic)
  Component is activated (activate is called)
  During activate Service S is registered
  ServiceEvent for S is sent
  DependencyManager for Component gets event and tries to bind
  Since the DependencyManager does not know the component instance yet, it cannot bind
  ServiceEvent handling terminates
  Component terminates activation

At the end Service S registered from the Component's activation method is never bound to the Component. This is certainly not spec compliant.

See the Sling POST Servlet [1] for an example.

[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
                
      was (Author: fmeschbe):
    This is not about getService. This is what happens:

  Component references Service S (0..n, dynamic)
  Component is activated (activate is called)
  During activate Service S is registered
  ServiceEvent for S is sent
  DependencyManager for Component gets event and tries to bind
  Since the DependencyManager does not know the component instance yet, it cannot bind
  ServiceEvent handling terminates
  Component terminates activation

At the end Service S registered from the Component's activation method is never bound to the Component. This is certainly not spec compliant.
                  
> 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
>
>
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Updated] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-3754:
-------------------------------------

    Attachment: FELIX-3754-improved.patch

Proposed improvement: Instead of really setting the component instances, they are placed in a temporary field. If activation succeeds, they are moved to the correct location. Otherwise they are removed again.

WDYT?
                
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497295#comment-13497295 ] 

David Jencks commented on FELIX-3754:
-------------------------------------

OK, now I see what you want.  I agree the behavior you want should work.  However your current implementation is unsatisfactory because it does expose the implementation object to getService before activate returns.
                
> 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
>
>
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496916#comment-13496916 ] 

Felix Meschberger commented on FELIX-3754:
------------------------------------------

This is not about getService. This is what happens:

  Component references Service S (0..n, dynamic)
  Component is activated (activate is called)
  During activate Service S is registered
  ServiceEvent for S is sent
  DependencyManager for Component gets event and tries to bind
  Since the DependencyManager does not know the component instance yet, it cannot bind
  ServiceEvent handling terminates
  Component terminates activation

At the end Service S registered from the Component's activation method is never bound to the Component. This is certainly not spec compliant.
                
> 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
>
>
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497859#comment-13497859 ] 

Felix Meschberger commented on FELIX-3754:
------------------------------------------

Yes, but this gets tricky to solve, I would assume.

In the simple immediate or delayed component use case we could just introduce another field, something like "tmpImplementationObject" which is considered by the ImmediateComponentManager.bind/unbind/update methods.

Its getting more complicated for the service factory component case where more than one instance may exist and be "in creation". So we would have a tmpImplentationObjects set for the bind/unbind/update methods ?

Will try to build a patch
                
> 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
>
>
> 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

[jira] [Updated] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-3754:
-------------------------------------

    Fix Version/s:     (was: scr-1.8.0)
                   scr-1.6.4
    
> 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
>
>
> 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

[jira] [Commented] (FELIX-3754) Services registered from within the activate method may not be bound

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498493#comment-13498493 ] 

David Jencks commented on FELIX-3754:
-------------------------------------

The patch looks OK to me, thanks!
                
> 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