Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-28-2017 10:48 PM
I have built a custom controller service and custom processor. I am able to build and run tests in IntelliJ on my laptop. Once the maven build is successfully complete, I copied all the 3 nar files and dropped them in the lib folder of NiFi.
In NiFi web interface, I can the see my custom service in Controller Service page. I am able to configure it and enable it. NiFi logs confirms the service is online. Now, when I drop the custom processor, I cannot see the service to choose in drop down. Event though it is service is running.
I verified the dependencies in pom for all nar modules.
Following is the error in the NiFi app log:
java.lang.IllegalArgumentException: ControllerServices may be referenced only via their interfaces; class org.pwc.nifi.customservice.LookupService is not an interface at org.apache.nifi.attribute.expression.language.StandardPropertyValue.asControllerService(StandardPropertyValue.java:172) ~[nifi-expression-language-1.1.1.jar:1.1.1] at org.pwc.nifi.customservice.LookupProcessor.onTrigger(LookupProcessor.java:79) ~[na:na] at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) ~[nifi-api-1.1.1.jar:1.1.1] at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099) ~[nifi-framework-core-1.1.1.jar:1.1.1] at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136) [nifi-framework-core-1.1.1.jar:1.1.1] at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47) [nifi-framework-core-1.1.1.jar:1.1.1] at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132) [nifi-framework-core-1.1.1.jar:1.1.1] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_91] at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_91] at java.lang.Thread.run(Unknown Source) [na:1.8.0_91]
I would appreciate if someone can help with :
Thank you.
Created 03-01-2017 02:03 PM
It is hard to tell without being able to see your code, but it seems like this is saying that in LookupProcessor you have a PropertyDescriptor that represents a Controller Service, but the class you specified is not the interface from nifi-customservice-api-nar, but instead it is the implementation from nifi-customservice-nar.
As an example, InvokeHttp uses SSLContextService:
SSLContextService is the interface that comes from nifi-standard-services-api:
The implementation is StandardSSLContextService which is is nifi-ssl-context-bundle:
Created 03-01-2017 02:03 PM
It is hard to tell without being able to see your code, but it seems like this is saying that in LookupProcessor you have a PropertyDescriptor that represents a Controller Service, but the class you specified is not the interface from nifi-customservice-api-nar, but instead it is the implementation from nifi-customservice-nar.
As an example, InvokeHttp uses SSLContextService:
SSLContextService is the interface that comes from nifi-standard-services-api:
The implementation is StandardSSLContextService which is is nifi-ssl-context-bundle:
Created 03-01-2017 05:16 PM
Your explanation helped me in identify the core issue. You are correct in assuming I was calling the service implementation rather than the interface. Once I made appropriate changes in my code and unit tested, I was able to drop in NiFi and have the integration testing done.
I was able to configure the custom service by adding it in drop down on the custom Lookup processor in NiFi Web UI.
THANK YOU for all the help!!!!