Valentin Valchev created FELIX-4572:
---------------------------------------

             Summary: Web Console may cause NPE on refresh packages
                 Key: FELIX-4572
                 URL: https://issues.apache.org/jira/browse/FELIX-4572
             Project: Felix
          Issue Type: Bug
          Components: Web Console
    Affects Versions: webconsole-4.2.2
            Reporter: Valentin Valchev
            Priority: Trivial


If you try to refresh packages on the webconsole or it's dependencies (like the 
fileupload) bundle, the following exception will be printed in the log file:

{code}
 [ERROR]8 : [HTTP] Problem while making answer to request 
/system/console/bundles/19 from client address 127.0.0.1:63063

java.lang.NullPointerException
        at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:207)
        at 
org.apache.felix.webconsole.SimpleWebConsolePlugin.getService(SimpleWebConsolePlugin.java:196)
        at 
org.apache.felix.webconsole.internal.core.BundlesServlet.getPackageAdmin(BundlesServlet.java:1403)
        at 
org.apache.felix.webconsole.internal.core.BundlesServlet.isFragmentBundle(BundlesServlet.java:715)
        at 
org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:358)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
        at 
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:493)
        at 
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:418)
{code}

The reason is that the refresh will cause the webconsole bundle to be 
restarted. Here is what happens:
# doPost entered
# sent package refresh
# webconsole bundle is stopped
# web console tries to access a service
# NPE
# doPost leaving

To prevent that, the bundle plugin should simply check if the bundleContext is 
null



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to