Support Questions
Find answers, ask questions, and share your expertise

Custom Controller Service could not be instantiated

Hello,


I am developing a custom controller service to interact with Apache Phoenix. After building the NAR files I faced an InstantiationException when deploying the NARs and restarting NiFi.


Could anyone with experience developing custom processors and especially custom controller services take a look at the below error output and help point me in the right direction? I have also attached the poms as well as the bundled dependencies


Thanks in advance!!!

Here is the error output:

ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.controller.ControllerService: Provider org.apache.nifi.phoenix.service.PhoenixDBCPService could not be instantiatedjava.util.ServiceConfigurationError: org.apache.nifi.controller.ControllerService: Provider org.apache.nifi.phoenix.service.PhoenixDBCPService could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:232) at java.util.ServiceLoader.access$100(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:142) at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:117) at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:771) at org.apache.nifi.NiFi.<init>(NiFi.java:160) at

org.apache.nifi.NiFi.main(NiFi.java:268)Caused by: java.lang.InstantiationException: org.apache.nifi.phoenix.service.PhoenixDBCPService at java.lang.Class.newInstance(Class.java:427) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 7 common frames omitted

Caused by: java.lang.NoSuchMethodException: org.apache.nifi.phoenix.service.PhoenixDBCPService.<init>() at java.lang.Class.getConstructor0(Class.java:3082) at java.lang.Class.newInstance(Class.java:412) ... 8 common frames omitted


bundled-dependencies-phoenix-service.txt
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Custom Controller Service could not be instantiated

All,


I've resolved the issue - in the file "src/main/resources/META-INF/services/org.apache.nifi.controller.ControllerService" I previously had it as "org.apache.nifi.phoenix.service.PhoenixDBCPService" and after changing it to "org.apache.nifi.phoenix.service.PhoenixConnectionPool" NiFi was able to startup and I was able to use/access my custom processors.

View solution in original post

1 REPLY 1

Re: Custom Controller Service could not be instantiated

All,


I've resolved the issue - in the file "src/main/resources/META-INF/services/org.apache.nifi.controller.ControllerService" I previously had it as "org.apache.nifi.phoenix.service.PhoenixDBCPService" and after changing it to "org.apache.nifi.phoenix.service.PhoenixConnectionPool" NiFi was able to startup and I was able to use/access my custom processors.

View solution in original post