You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running in an OSGI environment, the TCCL may have access to a component, but the component might be accessing a resource implementing an interface to which the TCCL has no access.
Expected behavior
If the interface class cannot be looked up through the usual path (TCCL, extension classloader), also try the classloader of the resource itself.
try {
String name = aDependencies[i].getInterfaceName();
if (name != null && name.length() > 0) {
>> Class<?> theInterface = loadUserClass(name); // <= this may only be available through the resourceClass'es classloader
>> Class<?> resourceClass = getResourceClass(qname); // <= this may be available
if (!theInterface.isAssignableFrom(resourceClass)) {
throw new ResourceInitializationException(
ResourceInitializationException.RESOURCE_DOES_NOT_IMPLEMENT_INTERFACE,
new Object[] { qname, aDependencies[i].getInterfaceName(),
aDependencies[i].getSourceUrlString() });
}
}
} catch (ClassNotFoundException e) {
throw new ResourceInitializationException(ResourceInitializationException.CLASS_NOT_FOUND,
new Object[] { aDependencies[i].getInterfaceName(),
aDependencies[i].getSourceUrlString() });
}
Please complete the following information:
Version: 3.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When running in an OSGI environment, the TCCL may have access to a component, but the component might be accessing a resource implementing an interface to which the TCCL has no access.
Expected behavior
If the interface class cannot be looked up through the usual path (TCCL, extension classloader), also try the classloader of the resource itself.
Please complete the following information:
The text was updated successfully, but these errors were encountered: