yakkisyou
yakkisyou

Reputation: 520

hive - java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveVariableSource

I installed hadoop-2.7.1 and hive-2.0.1.

Here is my directory structure:

~/hadoop-2.7.1/ # hadoop directory
~/hadoop-2.7.1/hive/apache-hive-2.0.1-bin # hive directory

My problem is that when I starting ./hive in ~/hadoop-2.7.1/hive/apache-hive-2.0.1-bin/bin/, this error occurs:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveVariableSource
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
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.conf.HiveVariableSource
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more

I just downloaded apache-hive-2.0.1-bin.tar.gz and unzip it. There is no any other configuration I did.

I'm using amazon ec2(ubuntu) and all of the hadoop nodes are started well.

Edit

Here is my hadoop-env.sh

...(omitted)...
export HADOOP_PID_DIR=${HADOOP_PID_DIR}
export HADOOP_SECURE_DN_PID_DIR=${HADOOP_PID_DIR}

# A string representing this instance of hadoop. $USER by default.
export HADOOP_IDENT_STRING=$USER

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=${JAVA_HOME}/bin:${PATH}
export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar:${HADOOP_CLASSPATH}

Upvotes: 2

Views: 8257

Answers (1)

Lorenzo Eccher
Lorenzo Eccher

Reputation: 301

I had a similar problem but with different issue.

I needed to remove HADOOP_* definitions from hadoop-env.sh.

In my configuration, I don't have them in .bashrc but I put them into a file in /etc/profile.d/

I found the solution here: http://sedeks.blogspot.com/2013/02/apache-hive-error-resolution.html

Upvotes: 1

Related Questions