Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4572

Web Console may cause NPE on refresh packages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • webconsole-4.2.2
    • webconsole-4.2.4
    • Web Console
    • None

    Description

      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:

       [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)
      

      The reason is that the refresh will cause the webconsole bundle to be restarted. Here is what happens:

      1. doPost entered
      2. sent package refresh
      3. webconsole bundle is stopped
      4. web console tries to access a service
      5. NPE
      6. doPost leaving

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

      Attachments

        Activity

          People

            v_valchev Valentin Valchev
            v_valchev Valentin Valchev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: