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

NPE when uninstall a bundle on enabled OSGi security

    XMLWordPrintableJSON

Details

    Description

      org.apache.felix.framework.BundleImpl#adapt returns null:

      public synchronized <A> A adapt(Class<A> type)
          {
              ....
              else if (type == BundleRevision.class)
              {
                  if (m_state == Bundle.UNINSTALLED)
                  {
                      return null;
                  }
      .....
      

      This causes a NPE:
      StackTrace:
      java.lang.NullPointerException
      at org.apache.felix.framework.SecurityProviderImpl.getSignerMatcher(SecurityProviderImpl.java:73)
      at org.apache.felix.framework.Felix.getSignerMatcher(Felix.java:4130)
      at org.apache.felix.framework.BundleImpl.getSignerCertificates(BundleImpl.java:901)
      at org.osgi.framework.SignerProperty.isBundleSigned(SignerProperty.java:110)
      at org.osgi.framework.AdminPermission$1.run(AdminPermission.java:884)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.osgi.framework.AdminPermission.getProperties(AdminPermission.java:875)
      at org.osgi.framework.AdminPermission.implies0(AdminPermission.java:671)
      at org.osgi.framework.AdminPermissionCollection.implies(AdminPermission.java:1014)
      at org.apache.felix.framework.security.util.Permissions.implies(Permissions.java:469)
      at org.apache.felix.framework.security.condpermadmin.ConditionalPermissionAdminImpl.eval(ConditionalPermissionAdminImpl.java:949)
      at org.apache.felix.framework.security.condpermadmin.ConditionalPermissionAdminImpl.hasPermission(ConditionalPermissionAdminImpl.java:882)
      at org.apache.felix.framework.SecurityProviderImpl.hasBundlePermission(SecurityProviderImpl.java:122)
      at org.apache.felix.framework.Felix.impliesBundlePermission(Felix.java:4139)
      at org.apache.felix.framework.BundleProtectionDomain.implies(BundleProtectionDomain.java:66)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at org.apache.felix.framework.BundleImpl.getLocation(BundleImpl.java:583)
      at org.apache.felix.cm.impl.ConfigurationManager.bundleChanged(ConfigurationManager.java:607)
      at org.apache.felix.framework.util.EventDispatcher$3.run(EventDispatcher.java:861)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:858)
      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
      at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:1088)
      at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
      at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:101)
      at java.lang.Thread.run(Unknown Source)

      Attachments

        Activity

          People

            karlpauls Karl Pauls
            michael.hirsch Michael Hirsch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: