You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Peter Turcsanyi (Jira)" <ji...@apache.org> on 2020/07/25 08:32:00 UTC

[jira] [Commented] (NIFI-7676) Nifi Processor dynamicallyModifiesClasspath doesn't work

    [ https://issues.apache.org/jira/browse/NIFI-7676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17164831#comment-17164831 ] 

Peter Turcsanyi commented on NIFI-7676:
---------------------------------------

[~vijendra07kulhade] It should work.
Are you sure {{CustomerProto}} is the fully-qualified class name of the class you are trying to load? It seems the package is missing.

> 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
>            Priority: Major
>
> 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)