Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 48071 invoked from network); 20 Feb 2009 16:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2009 16:39:27 -0000 Received: (qmail 74685 invoked by uid 500); 20 Feb 2009 16:39:25 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 74645 invoked by uid 500); 20 Feb 2009 16:39:24 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 74619 invoked by uid 99); 20 Feb 2009 16:39:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 08:39:24 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 16:39:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09C47234C4AE for ; Fri, 20 Feb 2009 08:39:02 -0800 (PST) Message-ID: <136103996.1235147942038.JavaMail.jira@brutus> Date: Fri, 20 Feb 2009 08:39:02 -0800 (PST) From: "Richard S. Hall (JIRA)" To: dev@felix.apache.org Subject: [jira] Resolved: (FELIX-952) Exception thrown when unregistering services because the bundle is stopped In-Reply-To: <171670364.1235144761881.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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.