You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ex...@apache.org on 2021/03/09 17:43:25 UTC

[nifi] branch main updated: NIFI-8212: When instantiating a temp component, ensure that nar class loader is set as the context class loader

This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new f09f2a6  NIFI-8212: When instantiating a temp component, ensure that nar class loader is set as the context class loader
f09f2a6 is described below

commit f09f2a6c85fd1c69808353eeea97f956d9e9271d
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Tue Mar 9 09:10:12 2021 -0500

    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 <ex...@apache.org>
---
 .../java/org/apache/nifi/nar/StandardExtensionDiscoveringManager.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 959a38e..6a68baf 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);