NIFI-8212: When instantiating a temp component, ensure that nar class loader is set as the context class loader

This closes #4877

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Mark Payne 2021-03-09 09:10:12 -05:00 committed by exceptionfactory
parent 79121a142e
commit f09f2a6c85
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 2 additions and 2 deletions

View File

@ -540,8 +540,8 @@ public class StandardExtensionDiscoveringManager implements ExtensionDiscovering
return null;
}
try {
final ClassLoader bundleClassLoader = bundle.getClassLoader();
final ClassLoader bundleClassLoader = bundle.getClassLoader();
try (final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(bundleClassLoader)) {
final Class<?> componentClass = Class.forName(classType, true, bundleClassLoader);
final ConfigurableComponent tempComponent = (ConfigurableComponent) componentClass.newInstance();
initializeTempComponent(tempComponent);