felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (FELIX-539) Intermittent IllegalArgumentException while using declarative services
Date Tue, 03 Jun 2008 09:58:44 GMT

    [ 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:
>         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.

View raw message