HBase java.lang.NoClassDefFoundError类路径错误 [英] HBase java.lang.NoClassDefFoundError classpath error

查看:396
本文介绍了HBase java.lang.NoClassDefFoundError类路径错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:这不是一个自制问题,我可以证实这一点,因为我从apache源代码运行HBase时得到完全相同的错误。



一直在努力获得HBase在我的笔记本上进行测试。基本上我使用以下命令在我的Mac上安装HBase:
brew install hbase 但是当我进入hbase shell并发出命令时,出现此错误:


线程main中的异常java.lang.NoClassDefFoundError:
org / apache / zookeeper / KeeperException

我尝试安装zookeeper( brew install zookeeper ),但仍然没有运气。在阅读消息后发现,hbase有自己的类路径,需要包含zookeeper jar包。我在使用eclipse时一直在努力,只是将所有的jar放在构建路径中,我从来没有真正处理过命令行。我做了一个搜索,jar放在目录中( /usr/local/Cellar/hbase//0.92.0/libexec/lib/zookeeper-3.4.2.jar ),但不知道如何添加它。



我一直在尝试 export CLASSPATH = / usr / local / Cellar / hbase / 0.92.0 / libexec / lib / zookeeper-3.4.2.jar:$ CLASSPATH (我有这个想法[这里] [1]),我可以想到但仍然没有运气,我不断收到同样的错误。

我想知道是否正确地分配类路径?或者如果HBase有自己的类路径分配?

解决方案

我试图启动hbase 0.94时遇到同样的问题.1。



我通过编辑文件/usr/local/hbase-0.94.1/conf/hbase-env.sh并添加了元素导出HBASE_CLASSPATH = / usr / local / hbase-0.94.1 / lib。
$ b zookeeper JAR位于HBase安装目录/ usr / local / hbase- 0.94.1 / lib。


UPDATE: this is not a homebrew issue, I can confirm this because I get the exact same error when run HBase from the apache source.

Been struggling to get HBase on my laptop for testing. Basically I install HBase on my mac by 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'm tried to install zookeeper(brew install zookeeper) but still no luck. After reading into the message it turns out that hbase has its own class path and needs the included zookeeper jar's in it. I've been struggling with this as I use eclipse and just put all my jars in the build path, I never really 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've been trying every variation of 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'm wondering if I'm assigning the class path correctly? or if HBase has its own of assigning the class path?

解决方案

I ran into the same problem while trying to start up 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 at "/usr/local/hbase-0.94.1/lib".

这篇关于HBase java.lang.NoClassDefFoundError类路径错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆