diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java index 959a38e79e..6a68bafb0e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-utils/src/main/java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java @@ -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);