Manish Agrawal
Manish Agrawal

Reputation: 794

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException

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 

Upvotes: 2

Views: 3732

Answers (2)

Niranjan Sarvi
Niranjan Sarvi

Reputation: 899

Faced the same problem, although the HADOOP_CLASSPATH lists all the necessary jars, the underlaying jars didn't have the read permission for the "hadoop" group.

After changing to read permission for the group using 'chmod' command resolved the issue.

Upvotes: 0

Manish Agrawal
Manish Agrawal

Reputation: 794

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}:{yours previous classpath}

Upvotes: 2

Related Questions