In JNDI ServiceHelper we should also check for the current thread's context
classloader's parent
------------------------------------------------------------------------------------------------
Key: ARIES-41
URL: https://issues.apache.org/jira/browse/ARIES-41
Project: Aries
Issue Type: Bug
Components: JNDI
Reporter: Lin Sun
Priority: Minor
Hi,
In the ServiceHelper.getBundleContext(), if the current thread's context
classloader is not an instance of BundleReference, we should also try to check
its parent to see if it is an instance of BundleReference. If it is, then
grab the bundle context accordingly. What do people think?
Proposed change:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl instanceof BundleReference) {
result = ((BundleReference)cl).getBundle().getBundleContext();
+ } else if (cl.getParent() instanceof BundleReference) {
+ result = ((BundleReference)cl.getParent()).getBundle().getBundleContext();
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.