2

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 

2 Answers 2

2

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}

Sign up to request clarification or add additional context in comments.

1 Comment

That solved all the problems! This advice should be in the tutorials on Apachi.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.