You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by hdev ml <hd...@gmail.com> on 2010/10/13 23:17:49 UTC

Exception in hive startup

Hi all,

I installed Hadoop 0.20.2 and installed hive 0.5.0.

I followed all the instructions on Hive's getting started page for setting
up environment variables like HADOOP_HOME

When I run from command prompt in the hive installation folder as "bin/hive"
it gives me following exception

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/hadoop/hive/conf/HiveConf
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
Caused by: java.lang.ClassNotFoundException:
org.apache.hadoop.hive.conf.HiveConf
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 3 more

Please note that my Hadoop installation is working fine.

What could be the cause of this? Anybody has any idea?

Thanks
Harshad

RE: Exception in hive startup

Posted by Steven Wong <sw...@netflix.com>.
Before mucking with the code, it should be worth a try to clarify the wiki first. It's easy to miss the point that <install-dir> is build/dist for most people; I guess people tend to mistake <install-dir> for <hive-root>. I would replace all references to <install-dir> by build/dist and just mention once that, for advanced users, you can change it to something else via blah blah config.


-----Original Message-----
From: Edward Capriolo [mailto:edlinuxguru@gmail.com] 
Sent: Wednesday, October 13, 2010 9:59 PM
To: user@hive.apache.org
Subject: Re: Exception in hive startup

On Thu, Oct 14, 2010 at 12:49 AM, Ted Yu <yu...@gmail.com> wrote:
> This should be documented in README.txt
>
> On Wed, Oct 13, 2010 at 6:14 PM, Steven Wong <sw...@netflix.com> wrote:
>>
>> You need to run hive_root/build/dist/bin/hive, not hive_root/bin/hive.
>>
>>
>>
>>
>>
>> From: hdev ml [mailto:hdevml@gmail.com]
>> Sent: Wednesday, October 13, 2010 2:18 PM
>> To: hive-user@hadoop.apache.org
>> Subject: Exception in hive startup
>>
>>
>>
>> Hi all,
>>
>> I installed Hadoop 0.20.2 and installed hive 0.5.0.
>>
>> I followed all the instructions on Hive's getting started page for setting
>> up environment variables like HADOOP_HOME
>>
>> When I run from command prompt in the hive installation folder as
>> "bin/hive" it gives me following exception
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/hadoop/hive/conf/HiveConf
>>         at java.lang.Class.forName0(Native Method)
>>         at java.lang.Class.forName(Class.java:247)
>>         at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.hadoop.hive.conf.HiveConf
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>         ... 3 more
>>
>> Please note that my Hadoop installation is working fine.
>>
>> What could be the cause of this? Anybody has any idea?
>>
>> Thanks
>> Harshad
>

It actually is.

Downloading and building
------------------------

- svn co http://svn.apache.org/repos/asf/hadoop/hive/trunk hive_trunk
- cd hive_trunk
- hive_trunk> ant package -Dtarget.dir=<install-dir> -Dhadoop.version=0.17.2.1

If you do not specify a value for target.dir it will use the default
value build/dist. Then you can run the unit tests if you want to make
sure it is correctly built:

...

Running Hive
------------

Hive uses hadoop that means:
- you must have hadoop in your path OR
- export HADOOP=<hadoop-install-dir>/bin/hadoop

To use hive command line interface (cli) from the shell:
$ cd <install-dir>
$ bin/hive

but for whatever reason people seem to been drawn to the bin/hive
right off the trunk. I think if we camouflaged that directory somehow
we might help stop people from wandering onto it.


Re: Exception in hive startup

Posted by Edward Capriolo <ed...@gmail.com>.
On Thu, Oct 14, 2010 at 12:49 AM, Ted Yu <yu...@gmail.com> wrote:
> This should be documented in README.txt
>
> On Wed, Oct 13, 2010 at 6:14 PM, Steven Wong <sw...@netflix.com> wrote:
>>
>> You need to run hive_root/build/dist/bin/hive, not hive_root/bin/hive.
>>
>>
>>
>>
>>
>> From: hdev ml [mailto:hdevml@gmail.com]
>> Sent: Wednesday, October 13, 2010 2:18 PM
>> To: hive-user@hadoop.apache.org
>> Subject: Exception in hive startup
>>
>>
>>
>> Hi all,
>>
>> I installed Hadoop 0.20.2 and installed hive 0.5.0.
>>
>> I followed all the instructions on Hive's getting started page for setting
>> up environment variables like HADOOP_HOME
>>
>> When I run from command prompt in the hive installation folder as
>> "bin/hive" it gives me following exception
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/hadoop/hive/conf/HiveConf
>>         at java.lang.Class.forName0(Native Method)
>>         at java.lang.Class.forName(Class.java:247)
>>         at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.hadoop.hive.conf.HiveConf
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>         ... 3 more
>>
>> Please note that my Hadoop installation is working fine.
>>
>> What could be the cause of this? Anybody has any idea?
>>
>> Thanks
>> Harshad
>

It actually is.

Downloading and building
------------------------

- svn co http://svn.apache.org/repos/asf/hadoop/hive/trunk hive_trunk
- cd hive_trunk
- hive_trunk> ant package -Dtarget.dir=<install-dir> -Dhadoop.version=0.17.2.1

If you do not specify a value for target.dir it will use the default
value build/dist. Then you can run the unit tests if you want to make
sure it is correctly built:

...

Running Hive
------------

Hive uses hadoop that means:
- you must have hadoop in your path OR
- export HADOOP=<hadoop-install-dir>/bin/hadoop

To use hive command line interface (cli) from the shell:
$ cd <install-dir>
$ bin/hive

but for whatever reason people seem to been drawn to the bin/hive
right off the trunk. I think if we camouflaged that directory somehow
we might help stop people from wandering onto it.

Re: Exception in hive startup

Posted by Ted Yu <yu...@gmail.com>.
This should be documented in README.txt

On Wed, Oct 13, 2010 at 6:14 PM, Steven Wong <sw...@netflix.com> wrote:

>  You need to run hive_root/build/dist/bin/hive, not hive_root/bin/hive.
>
>
>
>
>
> *From:* hdev ml [mailto:hdevml@gmail.com]
> *Sent:* Wednesday, October 13, 2010 2:18 PM
> *To:* hive-user@hadoop.apache.org
> *Subject:* Exception in hive startup
>
>
>
> Hi all,
>
> I installed Hadoop 0.20.2 and installed hive 0.5.0.
>
> I followed all the instructions on Hive's getting started page for setting
> up environment variables like HADOOP_HOME
>
> When I run from command prompt in the hive installation folder as
> "bin/hive" it gives me following exception
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/hadoop/hive/conf/HiveConf
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.hadoop.hive.conf.HiveConf
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>         ... 3 more
>
> Please note that my Hadoop installation is working fine.
>
> What could be the cause of this? Anybody has any idea?
>
> Thanks
> Harshad
>

Re: Exception in hive startup

Posted by Edward Capriolo <ed...@gmail.com>.
We really need to hide <trunk>/bin/hive somewhere that people can not
find it so easily.

Edward

On Wed, Oct 13, 2010 at 9:14 PM, Steven Wong <sw...@netflix.com> wrote:
> You need to run hive_root/build/dist/bin/hive, not hive_root/bin/hive.
>
>
>
>
>
> From: hdev ml [mailto:hdevml@gmail.com]
> Sent: Wednesday, October 13, 2010 2:18 PM
> To: hive-user@hadoop.apache.org
> Subject: Exception in hive startup
>
>
>
> Hi all,
>
> I installed Hadoop 0.20.2 and installed hive 0.5.0.
>
> I followed all the instructions on Hive's getting started page for setting
> up environment variables like HADOOP_HOME
>
> When I run from command prompt in the hive installation folder as "bin/hive"
> it gives me following exception
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/hadoop/hive/conf/HiveConf
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.hadoop.hive.conf.HiveConf
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>         ... 3 more
>
> Please note that my Hadoop installation is working fine.
>
> What could be the cause of this? Anybody has any idea?
>
> Thanks
> Harshad

RE: Exception in hive startup

Posted by Steven Wong <sw...@netflix.com>.
You need to run hive_root/build/dist/bin/hive, not hive_root/bin/hive.


From: hdev ml [mailto:hdevml@gmail.com]
Sent: Wednesday, October 13, 2010 2:18 PM
To: hive-user@hadoop.apache.org
Subject: Exception in hive startup

Hi all,

I installed Hadoop 0.20.2 and installed hive 0.5.0.

I followed all the instructions on Hive's getting started page for setting up environment variables like HADOOP_HOME

When I run from command prompt in the hive installation folder as "bin/hive" it gives me following exception

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 3 more

Please note that my Hadoop installation is working fine.

What could be the cause of this? Anybody has any idea?

Thanks
Harshad

Re: Exception in hive startup

Posted by Ted Yu <yu...@gmail.com>.
Make sure hive-exec-0.7.0.jar is under lib/ dir.

Found: HiveConf
Class: org.apache.hadoop.hive.conf.HiveConf
Package: org.apache.hadoop.hive.conf
Library Name: hive-exec-0.7.0.jar
Library Path: /Users/tyu/hive/lib/hive-exec-0.7.0.jar

On Wed, Oct 13, 2010 at 2:17 PM, hdev ml <hd...@gmail.com> wrote:

> Hi all,
>
> I installed Hadoop 0.20.2 and installed hive 0.5.0.
>
> I followed all the instructions on Hive's getting started page for setting
> up environment variables like HADOOP_HOME
>
> When I run from command prompt in the hive installation folder as
> "bin/hive" it gives me following exception
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/hadoop/hive/conf/HiveConf
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.hadoop.hive.conf.HiveConf
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>         ... 3 more
>
> Please note that my Hadoop installation is working fine.
>
> What could be the cause of this? Anybody has any idea?
>
> Thanks
> Harshad
>