HBase class error java.lang.NoClassDefFoundError

UPDATE: this is not a homegrown problem, I can confirm this because I get the same error when starting HBase from apache source.

There was an attempt to get HBase on my laptop for testing. I basically install HBase on my mac using: brew install hbase , but when I go into the hbase shell and issue a command, I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org / Apache / Zookeeper / KeeperException

I am trying to install zookeeper ( brew install zookeeper ) but still no luck. After reading the message, it turns out that hbase has its own class path and needs the zookeeper bank included in it. I struggled with this since I use eclipse and just put all my banks in the build path, I never deal with the command line. I did a search and the jar is in the directory ( /usr/local/Cellar/hbase//0.92.0/libexec/lib/zookeeper-3.4.2.jar ) but not sure how to add it.

I tried every variation export CLASSPATH=/usr/local/Cellar/hbase/0.92.0/libexec/lib/zookeeper-3.4.2.jar:$CLASSPATH (got the idea [here] [1]) that I can think of but still no luck, I keep getting the same error.

I am wondering if I correctly set the class path correctly? or if HBase has its own class path?

0
source share
3 answers

I ran into the same problem trying to run hbase 0.94.1.

I fixed this by editing the file "/usr/local/hbase-0.94.1/conf/hbase-env.sh" and adding the element "export HBASE_CLASSPATH = / usr / local / hbase-0.94.1 / lib".

The Zookeeper JAR is located in the HBase installation on the page "/usr/local/hbase-0.94.1/lib".

+6
source

This did not work for me. I created a small bulk import project on github. You can find there under the zub / lib ATM, as well as other used banks. Not sure which jar files are not needed.

To add a jar file to Eclipse:

 Project/Properties/Add Jars../ go to libs folder and select all jars 

Link: HBase bulk upload example

0
source

Or make sure you add HBASE_HOME to your environment variables (with the path to your hbase folder).

0
source

Source: https://habr.com/ru/post/1493732/


All Articles