Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Custom NiFi processor gets "ControllerServices may be referenced only via their interfaces" error.

avatar
Contributor

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.

  1. nifi-customservice-api-nar
  2. nifi-customservice-nar
  3. nifi-LookupProcessor-nar

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 :

  1. Resolving missing service in drop down when configuring the processor in properties.
  2. Resolving error "java.lang.IllegalArgumentException: ControllerServices may be referenced only via their interfaces"

Thank you.

1 ACCEPTED SOLUTION

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
2 REPLIES 2

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Contributor

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!!!!