hive2.x 安装时候报错org/apache/hadoop/crypto/key/KeyProvider

hive2.2与hadoop2.4不兼容!!!


来历就是自己在用hadoop2.4安装hive2.2的时候(hbase与hive整合需要hive2),抛出的初始化错误。 java.lang.ExceptionInInitializerError
自己百度了两天的这个异常当然改不掉。然后往下往异常下边找
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/crypto/key/KeyProvider
这个类不存在,然后就贴到网上搜,搜到这篇文章
https://blog.csdn.net/u013013024/article/details/52702449
虽然他说的是maven项目导入的时, hadoop-common2.7jar包未发现。但是原理大同小异。
想着自己的hadoop2.4也有相应的jar包呀,可将相应jar代码拆开以后没有crypto包
于是就通过maven下载hadoop-common2.7.jar用破解jar工具拆开。。。服气,有crypto这个包。。


Logging initialized using configuration in jar:file:/home/hadoop/hive2.2/lib/hive-common-2.2.0.jar!/hive-log4j2.properties Async: true
Exception in thread "main" java.lang.ExceptionInInitializerError
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.apache.hive.common.util.ReflectionUtil.newInstance(ReflectionUtil.java:83)
	at org.apache.hadoop.hive.ql.exec.Registry.registerUDAF(Registry.java:238)
	at org.apache.hadoop.hive.ql.exec.Registry.registerUDAF(Registry.java:231)
	at org.apache.hadoop.hive.ql.exec.FunctionRegistry.(FunctionRegistry.java:430)
	at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:243)
	at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:227)
	at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:384)
	at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:328)
	at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:308)
	at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:284)
	at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:581)
	at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:549)
	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:750)
	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/crypto/key/KeyProvider
	at org.apache.hadoop.hive.shims.ShimLoader.getHadoopShims(ShimLoader.java:102)
	at org.apache.hadoop.hive.ql.udf.UDAFPercentile.(UDAFPercentile.java:51)
	... 23 more
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/crypto/key/KeyProvider
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:190)
	at org.apache.hadoop.hive.shims.ShimLoader.createShim(ShimLoader.java:151)
	at org.apache.hadoop.hive.shims.ShimLoader.loadShims(ShimLoader.java:146)
	at org.apache.hadoop.hive.shims.ShimLoader.getHadoopShims(ShimLoader.java:99)
	... 24 more
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.crypto.key.KeyProvider
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 29 more
网上都在说hive2.0与所有hadoop2.x兼容,没想到hive2.2变换恁大。

用hive2.2的可以用hadoop2.8版本。



你可能感兴趣的:(软件安装)