Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: webconsole-4.0.0
    • Fix Version/s: webconsole-4.2.0
    • Component/s: Web Console
    • Labels:
      None

      Description

      When uninstalling a bundle from the bundle list, a NPE in the framework occurs - I think this starts to happen with framework 4.0.3, but I think this is not a problem of the framework but a bug in the web console.

      This is the stack trace:
      14.09.2012 13:44:54.858 INFO [0:0:0:0:0:0:0:1%0 [1347623094009] POST /system/console/bundles/108 HTTP/1.1] servletengine Servlet threw exception: java.lang.NullPointerException
      at org.apache.felix.framework.PackageAdminImpl.getBundleType(PackageAdminImpl.java:112)
      at org.apache.felix.webconsole.internal.core.BundlesServlet.isFragmentBundle(BundlesServlet.java:715)
      at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:358)

      Although the bundle is uninstalled, the web console tries to find out whether the bundle is a fragment to report a status in the json. I think this doesn't make sense for an uninstalled bundle

        Issue Links

          Activity

          Hide
          Felix Meschberger added a comment -

          Close after release

          Show
          Felix Meschberger added a comment - Close after release
          Hide
          Felix Meschberger added a comment -

          Done in Rev. 1418285 moving the framework bug (FELIX-3670) workaround to the isFragment method.

          Show
          Felix Meschberger added a comment - Done in Rev. 1418285 moving the framework bug ( FELIX-3670 ) workaround to the isFragment method.
          Hide
          Felix Meschberger added a comment -

          I think the fix is incomplete: It should be applied closer to the actual NPE cause and to also properly locate the workaround.

          Show
          Felix Meschberger added a comment - I think the fix is incomplete: It should be applied closer to the actual NPE cause and to also properly locate the workaround.
          Hide
          Carsten Ziegeler added a comment -

          I've changed the code to only check for fragment if the bundle has not the state uninstalled

          Show
          Carsten Ziegeler added a comment - I've changed the code to only check for fragment if the bundle has not the state uninstalled
          Hide
          Felix Meschberger added a comment -

          You are right. I have created FELIX-3670 for the framework.

          Show
          Felix Meschberger added a comment - You are right. I have created FELIX-3670 for the framework.
          Hide
          Richard S. Hall added a comment -

          So, should we clone this bug for framework too?

          Show
          Richard S. Hall added a comment - So, should we clone this bug for framework too?
          Hide
          Carsten Ziegeler added a comment -

          Ok, I agree to your conclusion - however the web console shouldn't call into the framework at all if it has uninstalled a bundle

          Show
          Carsten Ziegeler added a comment - Ok, I agree to your conclusion - however the web console shouldn't call into the framework at all if it has uninstalled a bundle
          Hide
          Felix Meschberger added a comment -

          I think this is a bug in the framework, though.

          The PackageAdmin.isBundleType is defined to throw an IllegalArgumentException "If the specified Bundle was not created by the same framework instance that registered this PackageAdmin service". I would assume calling this method on an uninstalled bundle should just return the information because it basically just accesses the bundle headers which must remain available after the bundle has been uninstalled.

          In fact the PackageAdminImpl.isBundleType does

          bundle.adapt(BundleRevision.class))

          which will return null if the bundle is uninstalled. Instead it should do

          bundle.adapt(BundleRevisionImpl.class))

          which never returns null and thus still provides access to the headers.

          Show
          Felix Meschberger added a comment - I think this is a bug in the framework, though. The PackageAdmin.isBundleType is defined to throw an IllegalArgumentException "If the specified Bundle was not created by the same framework instance that registered this PackageAdmin service". I would assume calling this method on an uninstalled bundle should just return the information because it basically just accesses the bundle headers which must remain available after the bundle has been uninstalled. In fact the PackageAdminImpl.isBundleType does bundle.adapt(BundleRevision.class)) which will return null if the bundle is uninstalled. Instead it should do bundle.adapt(BundleRevisionImpl.class)) which never returns null and thus still provides access to the headers.

            People

            • Assignee:
              Felix Meschberger
              Reporter:
              Carsten Ziegeler
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development