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 2008/06/03 11:58:44 UTC

[jira] Issue Comment Edited: (FELIX-539) Intermittent IllegalArgumentException while using declarative services

    [ https://issues.apache.org/jira/browse/FELIX-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601878#action_12601878 ] 

fmeschbe edited comment on FELIX-539 at 6/3/08 2:58 AM:
-----------------------------------------------------------------

In Rev. 662404 I committed an ehancement to synchronize service registration and unregistration to fix FELIX-550. I assume that this fix also would fix this issue.

Reasoning: This situation occurrs if a component has been marked satisfied (aka active) and is working on registering the service. At the same time another thread is taking down the component. This should only be possible after the first thread left the synchronized block.

But when the first thread leaves the synchronized block, the service lock is active while the service is being registered. So the second trhead may enter the synchronized deactivateInternal method to start deactivation but must wait with service unregistration until the servlce lock has been released.

Thus the deactivating thread waits for the service registration by the first thread to finish before actually unregistering the service and deactivating the component.

      was (Author: fmeschbe):
    In Rev. 662404 I committed an ehancement to synchronize service registration and unregistration to fix FELIX-550. I assume that this fix also would fix this issue.
  
> Intermittent IllegalArgumentException while using declarative services   
> -------------------------------------------------------------------------
>
>                 Key: FELIX-539
>                 URL: https://issues.apache.org/jira/browse/FELIX-539
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: felix-1.0.4
>            Reporter: Rajini Sivaram
>            Assignee: Felix Meschberger
>
> I get an intermittent (very rare) exception while running tests using declarative services under Felix. 
>  
> The exception stack trace shows:
>  
> java.lang.IllegalArgumentException: Service object cannot be null.
>         at org.apache.felix.framework.Felix.registerService(Felix.java:2661)
>         at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:254)
>         at org.apache.felix.scr.impl.AbstractComponentManager.registerComponentService(AbstractComponentManager.java:598)
>         at org.apache.felix.scr.impl.AbstractComponentManager.activateInternal(AbstractComponentManager.java:426)
>         at org.apache.felix.scr.impl.AbstractComponentManager.enableInternal(AbstractComponentManager.java:323)
>         at org.apache.felix.scr.impl.AbstractComponentManager.access$000(AbstractComponentManager.java:36)
>         at org.apache.felix.scr.impl.AbstractComponentManager$1.run(AbstractComponentManager.java:94)
>         at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:85)
>  
> Whenever I have seen the exception, logs suggest that the components were being reactivated at around the same time. The stack trace from the debugger when reactivate occurs shows:
>  
>         ImmediateComponentManager.disposeImplementationObject(Object, ComponentContext) line: 273
>         ImmediateComponentManager.deleteComponent() line: 151
>         ImmediateComponentManager(AbstractComponentManager).deactivateInternal() line: 469
>         ImmediateComponentManager(AbstractComponentManager).reactivate() line: 142
>         ImmediateComponentManager.reconfigure(Dictionary) line: 399
>         ImmediateComponentManager$1.updated(Dictionary) line: 90
>         ConfigurationManager$ManagedServiceUpdate.run() line: 863
>         UpdateThread.run() line: 89
>  
> Would it be possible to introduce some synchronization during activate/deactivate to avoid the service/component being set to null? I am using Felix framework 1.1.0-SNAPSHOT and SCR 1.0.0.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.