[ https://issues.apache.org/jira/browse/FELIX-952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard S. Hall resolved FELIX-952. ----------------------------------- Resolution: Fixed Fix Version/s: felix-1.6.0 Assignee: Richard S. Hall I modified ServiceRegistry.unregisterServices() to check to see if the registration is valid before calling unregister(), so I think this should solve your issue. Please close this issue if you are satisfied. > Exception thrown when unregistering services because the bundle is stopped > -------------------------------------------------------------------------- > > Key: FELIX-952 > URL: https://issues.apache.org/jira/browse/FELIX-952 > Project: Felix > Issue Type: Bug > Components: Framework > Reporter: Guillaume Nodet > Assignee: Richard S. Hall > Fix For: felix-1.6.0 > > > I have a bundle which happens to unregister some services from a > ServiceListener. > What happens is that when the bundle is stopped, > ServiceRegistry#unregisterServices(Bundle) is called. > This method unregister services one by one. When one service has been > unregistered, my listener is called which unregister another service. > When the loop iterator to this very service, an exception is thrown. > {code} > Caused by: java.lang.IllegalStateException: Service already unregistered. > at > org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:108) > at > org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:135) > at org.apache.felix.framework.Felix._stopBundle(Felix.java:2032) > at org.apache.felix.framework.Felix.stopBundle(Felix.java:1952) > at org.apache.felix.framework.Felix._uninstallBundle(Felix.java:2106) > at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2076) > at > org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:425) > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.