Vijendra Kulhade created NIFI-7676:
--------------------------------------

             Summary: Nifi Processor dynamicallyModifiesClasspath doesn't work
                 Key: NIFI-7676
                 URL: https://issues.apache.org/jira/browse/NIFI-7676
             Project: Apache NiFi
          Issue Type: Bug
          Components: Configuration
    Affects Versions: 1.11.4
            Reporter: Vijendra Kulhade


I am trying to pass custom jar to add in the class path for my Custom Processor.

I have used below PropertyDescriptor 
{code:java}
static final PropertyDescriptor ADDITIONAL_CLASSPATH_RESOURCES = new 
PropertyDescriptor.Builder()
        .name("Additional Classpath Resources")
        .displayName("Additional Classpath")
        .description("A comma-separated list of paths to files and/or 
directories that will be added to the classpath and used for loading native 
libraries. " +
                "When specifying a directory, all files with in the directory 
will be added to the classpath, but further sub-directories will not be 
included.")
        .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
        .dynamicallyModifiesClasspath(true)
        
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
        .build();
{code}
Also in onTrigger trying to read get the Class like this.
{code:java}
Class<?> cls = 
Thread.currentThread().getContextClassLoader().loadClass("CustomerProto");
Method m = cls.getDeclaredMethod("getDefaultInstance");{code}
I am getting ClassNotFoundException.

 

I tried referring the existing Nifi JoltTransformRecord Processor. 

[https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-jolt-record-bundle/nifi-jolt-record-processors/src/main/java/org/apache/nifi/processors/jolt/record/JoltTransformRecord.java#L156]

Tried checking the test cases for this processor

I found that there was no positive test case for dynamicallyModifiesClasspath.

All the test cases are ignoring the custom class. 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to