marklogic-community / marklogic-nifi-incubator

A collaboration space for processors, recipes, templates, etc. NOTE: improvements made to the connector in this project have been incorporated into the MarkLogic NiFi repository (https://github.com/marklogic/nifi).
Apache License 2.0
4 stars 11 forks source link

Unable to start nifi 1.12 with Marklogic nifi incubator 1.9.1.4 #91

Closed frankietsang closed 3 years ago

frankietsang commented 4 years ago

I tried to use Marklogic nifi incubator 1.9.1.4 with nifi 1.12 and was not able to start nifi. Once I switched to nifi 1.11.4, I could start nifi with Marklogic nifi incubator 1.9.1.4 without any issue.

From the nifi-app.log, I found the following error:

2020-09-13 15:29:55,946 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.controller.ControllerService: Provider org.apache.nifi.marklogic.controller.DefaultMarkLogicDatabaseClientService could not be instantiated java.util.ServiceConfigurationError: org.apache.nifi.controller.ControllerService: Provider org.apache.nifi.marklogic.controller.DefaultMarkLogicDatabaseClientService 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.StandardExtensionDiscoveringManager.loadExtensions(StandardExtensionDiscoveringManager.java:156) at org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:131) at org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:117) at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:1048) at org.apache.nifi.NiFi.(NiFi.java:158) at org.apache.nifi.NiFi.(NiFi.java:72) at org.apache.nifi.NiFi.main(NiFi.java:301) Caused by: java.lang.NoClassDefFoundError: org/apache/nifi/ssl/SSLContextService$ClientAuth at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) at java.lang.Class.getConstructor0(Class.java:3075) at java.lang.Class.newInstance(Class.java:412) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 9 common frames omitted Caused by: java.lang.ClassNotFoundException: org.apache.nifi.ssl.SSLContextService$ClientAuth at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 14 common frames omitted 2020-09-13 15:29:55,947 INFO [Thread-1] org.apache.nifi.NiFi Initiating shutdown of Jetty web server... 2020-09-13 15:29:55,948 INFO [Thread-1] org.apache.nifi.NiFi Jetty web server shutdown completed (nicely or otherwise).

dmcassel commented 4 years ago

NiFi has a StandardRestrictedSSLContextService and a StandardSSLContextService. The description of the second in NiFi 1.11.4 says that the Restricted version should be preferred. I may be that the regular one was removed in NiFi 1.12.0.

hanshuebner commented 4 years ago

It seems that the ClientAuth class has been moved from being nested in org.apache.nifi.ssl.SSLContextService to being the standalone class org.apache.nifi.security.util.ClientAuth. From looking at the changes between 1.11.4 to 1.12.0, this particular problem seems to be easy to change. Overall, though, the changes between the two nifi versions seem rather extensive. Is anyone committed to making the required changes to the MarkLogic NiFi processors so that they can be used with 1.12.0 yet?

awanczowski commented 4 years ago

Not sure if this resolves your issue here. But, I tried Nifi 1.12.1 with the 1.9.1.4 NARs. Everything seems to start up fine. There seems to be a fix here for Keystores. Perhaps there is something in these changes that help.

https://cwiki.apache.org/confluence/display/NIFI/Release+Notes#ReleaseNotes-Version1.12.1

hanshuebner commented 4 years ago

@awanczowski Thank you for reporting this. I can confirm that I can load the 1.9.1.4 NARs into NiFi 1.12.1 as well!

awanczowski commented 4 years ago

FYI, I did test the connection using an SSL Context with JKS Keystore. It worked hitting a public Data Hub Service without issue.

dmcassel commented 3 years ago

I believe this issue can be closed. I've been working with NiFi 1.12.1 and the 1.9.1.4 seems to be starting up without a problem.