线程"main"中的异常java.lang.NoClassDefFoundError:org/apache/hadoop/hive/ql/CommandNeedRetryException [英] Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
问题描述
当我使用"hive shell"命令启动hive时.它给了我以下例外:
When I am starting hive using 'hive shell' command. Its giving me below exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/common/LogUtils$LogInitializationException
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.common.LogUtils$LogInitializationException
推荐答案
实际上,这是由于hadoop设置引起的.我已经明确设置了HADOOP_CLASSPATH(仅适用于Java jar),并且在运行hive时,它需要更多的hadoop jar文件,并且同样是通过hive配置文件添加的.因此,我们需要在hadoop-env.sh中设置HADOOP_CLASSPATH,如下所示:
Actually this was due to hadoop setup. I have set the HADOOP_CLASSPATH explicitly (as Java jars only) and while running hive, it need some more hadoop jar files and the same is add through hive configuration file. So we need to set HADOOP_CLASSPATH in hadoop-env.sh as below
export HADOOP_CLASSPATH = $ {HADOOP_CLASSPATH}:{您以前的类路径}
export HADOOP_CLASSPATH = ${HADOOP_CLASSPATH}:{yours previous classpath}
这篇关于线程"main"中的异常java.lang.NoClassDefFoundError:org/apache/hadoop/hive/ql/CommandNeedRetryException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!