0
votes

I am using Hortonworks HDF 1.2.0.1 sandbox and I am trying to add the PutHiveQL processor which will be included in the 1.0 nifi release. So far I have generated the .nar archive, but nifi doesn't start anymore when it is imported into the /lib directory. I get a java.lang.UnsupportedClassVersionError in the nifi-app.log:

2016-07-15 13:22:37,158 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi 
due to java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: 
Provider nifi.test.processors.PutHiveQL could not be 
 instantiated java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider nifi.test.processors.PutHiveQL could not be instantiated
    at java.util.ServiceLoader.fail(ServiceLoader.java:224) ~[na:1.7.0_95]
    at java.util.ServiceLoader.access$100(ServiceLoader.java:181) ~[na:1.7.0_95]
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377) ~[na:1.7.0_95]
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445) ~[na:1.7.0_95]
    at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:107) ~[nifi-nar-utils-0.6.0.1.2.0.1-1.jar:0.6.0.1.2.0.1-1]
    at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:88) ~[nifi-nar-utils-0.6.0.1.2.0.1-1.jar:0.6.0.1.2.0.1-1]
    at org.apache.nifi.NiFi.<init>(NiFi.java:120) ~[nifi-runtime-0.6.0.1.2.0.1-1.jar:0.6.0.1.2.0.1-1]
    at org.apache.nifi.NiFi.main(NiFi.java:227) ~[nifi-runtime-0.6.0.1.2.0.1-1.jar:0.6.0.1.2.0.1-1] 

Caused by: java.lang.UnsupportedClassVersionError: org/apache/nifi/processor/util/StandardValidators : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_95]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[na:1.7.0_95]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.7.0_95]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[na:1.7.0_95]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0_95]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_95]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_95]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_95]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_95]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_95]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_95]
    at nifi.test.processors.PutHiveQL.<clinit>(PutHiveQL.java:73) ~[nifi-hiveQLProcessor-1.0-SNAPSHOT.nar-unpacked/:na]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_95]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_95]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_95]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_95]
    at java.lang.Class.newInstance(Class.java:383) ~[na:1.7.0_95]
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373) ~[na:1.7.0_95]
    ... 5 common frames omitted

Seems like the runtime jdk and the one used for compiling is not the same. I've checked nifi, and it is using jdk 1.7 (while I was running 1.8 on my machine). I've installed the same in my system, but I am still getting the same error. Any suggestion on how to fix that? Thank you!


EDIT

I tried installing nifi 0.7 locally and adding the custom processor but I get the same exact behavior.

1

1 Answers

2
votes

If you built the Hive NAR from NiFi master (1.0.0) branch, it is compiling it for Java 1.8 which probably won't work with HDF 1.2.0.1 because that was compiled for Java 1.7. NiFi 1.0.0 is moving to Java 1.8 as a minimum.

You could checkout the 0.x branch of NiFi and build the Hive processors from there because that is still Java 1.7, or you can get the latest 0.7.0 NiFi release which already has the Hive NAR and just take the NAR from the lib directory:

https://nifi.apache.org/download.html