java.lang.NoClassDefFoundError: org/apache/htrace/core/HTraceConfiguration

huangapple go评论72阅读模式
英文:

java.lang.NoClassDefFoundError: org/apache/htrace/core/HTraceConfiguration

问题

我正在使用 Hadoop 2.9.1 和 HBase 2.1.0 的独立本地模式。

当我尝试在 bin 文件夹中使用 sudo start-hbase.sh 启动 HBase 2.1.0 时,我收到以下错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/htrace/core/HTraceConfiguration
	at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:153)
	at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
	at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)
Caused by: java.lang.ClassNotFoundException: org.apache.htrace.core.HTraceConfiguration
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

这是我的 hbase-site.xml 文件内容:

<configuration>
	<property>
		<name>hbase.rootdir</name>
		<value>/home/niyazmohamed/bigdata/upgraded_versions/hbase-2.1.0/hbasedir</value>
	</property>

	<property>
		<name>hbase.zookeeper.quorum</name>
		<value>localhost</value>
	</property>

	<property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>

	<property>
		<name>hbase.zookeeper.property.clientPort</name>
		<value>2181</value>
	</property>

	<property>
		<name>hbase.zookeeper.property.dataDir</name>
		<value>/home/niyazmohamed/bigdata/upgraded_versions/hbase-2.1.0/zookeeper</value>
	</property>

</configuration>

当我尝试启动版本为 1.2.0 的 HBase 时,它成功启动,并且 hbase shell 也可以访问,CRUD 操作也成功。

已经设置了 Hadoop 和 HBase 的路径。只有通过这样,我才能运行 HBase-1.2.0。

只有在 HBase-2.1.0 中才会出现这个问题。

非常感谢您提前的帮助!

英文:

I am using hadoop 2.9.1 and hbase 2.1.0 at stand-alone local mode.

When I tried staring HBase 2.1.0 using sudo start-hbase.sh at bin folder, I got below error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/htrace/core/HTraceConfiguration
	at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:153)
	at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
	at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)
Caused by: java.lang.ClassNotFoundException: org.apache.htrace.core.HTraceConfiguration
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

This is my hbase-site.xml

<configuration>
	<property>
		<name>hbase.rootdir</name>
		<value>/home/niyazmohamed/bigdata/upgraded_versions/hbase-2.1.0/hbasedir</value>
	</property>

	<property>
		<name>hbase.zookeeper.quorum</name>
		<value>localhost</value>
	</property>

	<property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>

	<property>
		<name>hbase.zookeeper.property.clientPort</name>
		<value>2181</value>
	</property>

	<property>
		<name>hbase.zookeeper.property.dataDir</name>
		<value>/home/niyazmohamed/bigdata/upgraded_versions/hbase-2.1.0/zookeeper</value>
	</property>

</configuration>

When I tried to start HBase version 1.2.0 , it started successfully and hbase shell was also accessible and CRUD operations were successful.

Hadoop and HBase path are set. Only by that , I was able to run HBase-1.2.0.

Only with HBase-2.1.0, this problem occurs.

Any help appreciated! Thanks in advance!

答案1

得分: 2

相关链接:
https://stackoverflow.com/questions/53106952/starting-hbase-java-lang-classnotfoundexception-org-apache-htrace-samplerbuild

在一些早期的 HBase 2.x 版本中缺少了 htrace-core-*-incubating.jar 文件。

如果在 $HBASE_HOME/lib/client-facing-thirdparty 目录中有 htrace-corejar 文件,

将该 jar 文件复制到 $HBASE_HOME/lib 目录中;否则

从 Maven 中下载该 Jar 文件,下载链接在这里:Maven 链接

然后放置到 $HBASE_HOME/lib 目录中。

你可以在 HBase 的 pom.xml 文件中查看版本为 hbase 2.1 的正确依赖版本为 htrace 4.2.0
https://github.com/apache/hbase/blob/rel/2.1.0/pom.xml#L1364

祝你好运。

英文:

Related:
https://stackoverflow.com/questions/53106952/starting-hbase-java-lang-classnotfoundexception-org-apache-htrace-samplerbuild

htrace-core-*-incubating.jar was missing from some early versions of HBase 2.x

If the htrace-core jar is in $HBASE_HOME/lib/client-facing-thirdparty

copy the jar to $HBASE_HOME/lib, otherwise

Download the Jar from Maven here

and place into $HBASE_HOME/lib

You can see in HBase pom.xml for version hbase 2.1 that htrace 4.2.0 is the correct version of the dependency.
https://github.com/apache/hbase/blob/rel/2.1.0/pom.xml#L1364

Goodluck.

huangapple
  • 本文由 发表于 2020年10月18日 03:22:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/64406439.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定