You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/02/26 19:54:25 UTC

[GitHub] [nifi] bbende commented on a change in pull request #4852: NIFI-8212: Refactored StandardExtensionDiscoveringManager to avoid us…

bbende commented on a change in pull request #4852:
URL: https://github.com/apache/nifi/pull/4852#discussion_r583882100



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/ExtensionBuilder.java
##########
@@ -463,10 +524,12 @@ private ControllerServiceNode createGhostControllerServiceNode() {
             Thread.currentThread().setContextClassLoader(detectedClassLoader);
 
             final Object extensionInstance = rawClass.newInstance();
+            final T cast = nodeType.cast(extensionInstance);
+            verifyControllerServiceReferences(cast, bundle.getClassLoader());

Review comment:
       When testing creating some processors I decided to try adding PutHDFS since it has `@RequiresInstanceClassLoading`, and it produced a ghost component with this exception in the logs...
   ```
   Caused by: java.lang.NullPointerException: null
   	at java.util.ArrayList.<init>(ArrayList.java:178)
   	at org.apache.nifi.processors.hadoop.PutHDFS.getSupportedPropertyDescriptors(PutHDFS.java:202)
   	at org.apache.nifi.components.AbstractConfigurableComponent.getPropertyDescriptors(AbstractConfigurableComponent.java:247)
   	at org.apache.nifi.controller.ExtensionBuilder.verifyControllerServiceReferences(ExtensionBuilder.java:433)
   	at org.apache.nifi.controller.ExtensionBuilder.createLoggableComponent(ExtensionBuilder.java:528)
   	at org.apache.nifi.controller.ExtensionBuilder.createLoggableProcessor(ExtensionBuilder.java:485)
   	... 170 common frames omitted
   ```
   I think the issue is that verify is calls `getSupportedPropertyDescritptors`, but we haven't called `initialize` on the component yet and we don't know if initialize is what sets up the component's property descriptors.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org