You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by vv...@apache.org on 2013/04/03 15:34:00 UTC

svn commit: r1464003 - /felix/trunk/webconsole-plugins/upnp/src/main/java/org/apache/felix/webconsole/plugins/upnp/internal/ControlServlet.java

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]);