diff --git a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java index c35ab392d6..f67df2b3ad 100644 --- a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java +++ b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java @@ -233,7 +233,10 @@ public class ExecuteGroovyScript extends AbstractProcessor { */ @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { - this.shell = null; + // Only re-create the shell if necessary, this helps if loading native libraries + if (ExecuteGroovyScript.ADD_CLASSPATH.equals(descriptor)) { + this.shell = null; + } this.compiled = null; this.scriptLastModified = 0; }