我正在尝试使用tomcat连接到HBASE并遇到以下错误。当我运行Hbase时,它的工作正常。
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2348)
at java.lang.Class.getDeclaredFields(Class.java:1779)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
以下是xml配置路径
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
<description>The directory shared by region servers.
</description>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
<description>The replication count for HLog and HFile storage.
</description>
</property>
</configuration>
答案 0 :(得分:2)
该异常清楚地表明在类路径中找不到类org.apache.hadoop.hbase.filter.Filter
。请在tomcat中将hbase-X.X.X.jar
添加到应用程序的类路径中。请确保使用正确版本的hbase jar文件。
答案 1 :(得分:0)
在tomcat的lib目录中复制hbase - * .jar并尝试重新运行。