Oracle 系统管理 - Linux 系统 - Backtrack 5 - 安全 - Juniper 技术 - Cisco 技术 - 思科模拟器 - Cisco 认证 - Cisco ios 下载

您现在的位置是:Docker > Centos > Exception in thread "main" java.lang.NoClassDefFoundError:

Exception in thread "main" java.lang.NoClassDefFoundError:

时间:2018-08-09 09:54  来源:未知  阅读次数: 复制分享 我要评论

问题如下:

[hadoop@gpmaster hadoop]$ hive

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException
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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 4 more
[hadoop@gpmaster hadoop]$ 


分析并解决方法如下:
我之前使用Tachyon作为分布式内存存储时,在Hadoop的配置文件hadoop-env.sh中,添加了如下内容:
export HADOOP_CLASSPATH=/home/hadoop/tachyon-0.7.1/clients/client/target/tachyon-client-0.7.1-jar-with-dependencies.jar
但是这样配置会覆盖掉HADOOP_CLASSPATH变量原本的信息,所以应该修改为:
export HADOOP_CLASSPATH=/home/hadoop/tachyon-0.7.1/clients/client/target/tachyon-client-0.7.1-jar-with-dependencies.jar:$HADOOP_CLASSPATH

相关资讯