Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18B0BF96A for ; Wed, 3 Apr 2013 13:34:25 +0000 (UTC) Received: (qmail 61508 invoked by uid 500); 3 Apr 2013 13:34:25 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 61394 invoked by uid 500); 3 Apr 2013 13:34:22 -0000 Mailing-List: contact commits-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 commits@felix.apache.org Received: (qmail 61371 invoked by uid 99); 3 Apr 2013 13:34:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 13:34:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 13:34:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 86BE123888EA; Wed, 3 Apr 2013 13:34:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1464003 - /felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java Date: Wed, 03 Apr 2013 13:34:00 -0000 To: commits@felix.apache.org From: vvalchev@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130403133400.86BE123888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vvalchev Date: Wed Apr 3 13:34:00 2013 New Revision: 1464003 URL: http://svn.apache.org/r1464003 Log: Fixed FELIX-4012 Sometimes the UPnP plugin fails to start due to device being removed from network https://issues.apache.org/jira/browse/FELIX-4012 Modified: felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java Modified: felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java?rev=1464003&r1=1464002&r2=1464003&view=diff ============================================================================== --- felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java (original) +++ felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java Wed Apr 3 13:34:00 2013 @@ -540,7 +540,13 @@ public class ControlServlet extends Http { UPnPDevice device = (UPnPDevice) bc.getService(ref); - UPnPIcon[] _icons = device == null ? null : device.getIcons(null); + UPnPIcon[] _icons = null; + try // Fix for FELIX-4012 + { + _icons = device == null ? null : device.getIcons(null); + } catch(IllegalStateException e) { // since OSGi r4.3 + device = null; // don't track that device, it has been removed + } if (_icons != null && _icons.length > 0) { icons.put(ref.getProperty(UPnPDevice.UDN), _icons[0]);