Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
All
Description
In org.apache.aries.jndi.services.ServiceHelper.CacheClearoutListener.add(BundleContext, ServiceKey) the following code will cause an NPE:
// try to use the system bundle for our listener,
// if that fails we fall back to the calling context
BundleContext systemBundle =
AccessController.doPrivileged(new PrivilegedAction<BundleContext>() {
public BundleContext run()
});
This can happen if a bundle FindHook hides the bundle 0 from the ctx bundle. A check for null should be done here:
BundleContext systemBundle =
AccessController.doPrivileged(new PrivilegedAction<BundleContext>() {
public BundleContext run()
});
This would allow jndi to work in such environments where bundle, service, and resolver hooks are used for isolation (e.g. subsystems).