You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by vikash pankaj <vi...@gmail.com> on 2022/04/14 11:46:05 UTC

Issue with Classloader while accessing resource in nifi 1.15.3 version

Hi,

I 'm having problem while retrieving files through classloader from the classpath which is modified dynamically with below PropertyDescriptor used in controllerService.
 
Here the Resources parameter is configured through expression Language with comma seperated
ex -
${zzz}/aaa,
${zzz}/aaa/resources,
${zzz}/bbb,
${zzz}/bbb/resources
while inspecting the classloader it just shows the file level entry in additionResourceUrsls variable from "aaa" and "bbb" folder, doesn't fetch any entry from the subfolder level due to this "Thread.currentThread().getContextClassLoader().getResource("fileName")" provide null InputStream reference.
 
 
public static final PropertyDescriptor RESOURCES = new PropertyDescriptor.Builder()
.name("XXXXX").description("YYYY")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.identifiesExternalResource(ResourceCardinality.MULTIPLE, ResourceType.DIRECTORY,ResourceType.FILE)
.dynamicallyModifiesClasspath(true).build();

we are doing nifi migration from 1.8 to 1.15.3 version

Regards,
Vikash Kumar.