felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Offermans (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (FELIX-2752) DepencyManager causes IllegalStateException by calling setProperties on unregistered ServiceRegistration
Date Tue, 28 Dec 2010 18:44:47 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Marcel Offermans reassigned FELIX-2752:
---------------------------------------

    Assignee: Marcel Offermans

> DepencyManager causes IllegalStateException by calling setProperties on unregistered
ServiceRegistration
> --------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-2752
>                 URL: https://issues.apache.org/jira/browse/FELIX-2752
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>         Environment: trunk revision: 1053368
>            Reporter: Bram de Kruijff
>            Assignee: Marcel Offermans
>
> When DependecyManager unBinds a component it calls unregister on the underlying ServiceRegistration
but does NOT nullify the m_registration reference to it. When at a later time it binds the
component again the reference is overwritten with a new one and all is well. However, when
the service implementaion calls setSetserviceProperties(props) on the component during the
start callback (and thus before registration) this method will call setProperties on the unregistered
m_registration resulting in an IllegalStateException thrown by org.apache.felix.framework.ServiceRegistrationImpl.
Below the stacktrace. Simple setting m_registration to null at line 910 seems to resolve the
issue.
> The service registration is no longer valid.
> java.lang.IllegalStateException: The service registration is no longer valid.
>         at org.apache.felix.framework.ServiceRegistrationImpl.setProperties(ServiceRegistrationImpl.java:107)
>         at org.apache.felix.dm.impl.ServiceRegistrationImpl.setProperties(ServiceRegistrationImpl.java:45)
>         at org.apache.felix.dm.impl.ComponentImpl.setServiceProperties(ComponentImpl.java:501)
>         at org.amdatu.core.fabrictest.internal.RemotableServiceImpl.start(RemotableServiceImpl.java:33)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.felix.dm.InvocationUtil.invokeMethod(InvocationUtil.java:45)
>         at org.apache.felix.dm.InvocationUtil.invokeCallbackMethod(InvocationUtil.java:13)
>         at org.apache.felix.dm.impl.ComponentImpl.invokeCallbackMethod(ComponentImpl.java:684)
>         at org.apache.felix.dm.impl.ComponentImpl.invoke(ComponentImpl.java:675)
>         at org.apache.felix.dm.impl.ComponentImpl.bindService(ComponentImpl.java:620)
>         at org.apache.felix.dm.impl.ComponentImpl.access$400(ComponentImpl.java:52)
>         at org.apache.felix.dm.impl.ComponentImpl$7.run(ComponentImpl.java:178)
>         at org.apache.felix.dm.impl.SerialExecutor$1.run(SerialExecutor.java:47)
>         at org.apache.felix.dm.impl.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>         at org.apache.felix.dm.impl.SerialExecutor.access$000(SerialExecutor.java:33)
>         at org.apache.felix.dm.impl.SerialExecutor$1.run(SerialExecutor.java:50)
>         at org.apache.felix.dm.impl.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>         at org.apache.felix.dm.impl.SerialExecutor.execute(SerialExecutor.java:68)
>         at org.apache.felix.dm.impl.ComponentImpl.calculateStateChanges(ComponentImpl.java:228)
>         at org.apache.felix.dm.impl.ComponentImpl.dependencyAvailable(ComponentImpl.java:371)
>         at org.apache.felix.dm.impl.dependencies.ServiceDependencyImpl.addedService(ServiceDependencyImpl.java:433)
>         at org.apache.felix.dm.tracker.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1145)
>         at org.apache.felix.dm.tracker.AbstractTracked.trackAdding(AbstractTracked.java:286)
>         at org.apache.felix.dm.tracker.AbstractTracked.track(AbstractTracked.java:232)
>         at org.apache.felix.dm.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1026)
>         at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)
>         at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
>         at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
>         at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3721)
>         at org.apache.felix.framework.Felix.access$000(Felix.java:80)
>         at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:717)
>         at org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:107)
>         at org.apache.felix.framework.Felix.registerService(Felix.java:2842)
>         at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)
>         at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:229)
>         at org.apache.felix.dm.impl.ComponentImpl.registerService(ComponentImpl.java:860)
>         at org.apache.felix.dm.impl.ComponentImpl.bindService(ComponentImpl.java:624)
>         at org.apache.felix.dm.impl.ComponentImpl.access$400(ComponentImpl.java:52)
>         at org.apache.felix.dm.impl.ComponentImpl$7.run(ComponentImpl.java:178)
>         at org.apache.felix.dm.impl.SerialExecutor$1.run(SerialExecutor.java:47)
>         at org.apache.felix.dm.impl.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>         at org.apache.felix.dm.impl.SerialExecutor.access$000(SerialExecutor.java:33)
>         at org.apache.felix.dm.impl.SerialExecutor$1.run(SerialExecutor.java:50)
>         at org.apache.felix.dm.impl.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>         at org.apache.felix.dm.impl.SerialExecutor.access$000(SerialExecutor.java:33)
>         at org.apache.felix.dm.impl.SerialExecutor$1.run(SerialExecutor.java:50)
>         at org.apache.felix.dm.impl.SerialExecutor.scheduleNext(SerialExecutor.java:84)
>         at org.apache.felix.dm.impl.SerialExecutor.execute(SerialExecutor.java:68)
>         at org.apache.felix.dm.impl.ComponentImpl.calculateStateChanges(ComponentImpl.java:228)
>         at org.apache.felix.dm.impl.ComponentImpl.start(ComponentImpl.java:406)
>         at org.apache.felix.dm.DependencyManager.add(DependencyManager.java:81)
>         at org.amdatu.core.fabric.service.FabricManagerServiceImpl.createRemote(FabricManagerServiceImpl.java:149)
>         at org.amdatu.core.fabrictest.shell.FabricManagerCommand.executeRemoteCreateCommand(FabricManagerCommand.java:260)

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


Mime
View raw message