felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
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 GMT
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]);



Mime
View raw message