Barro
Barro

Reputation: 335

Hbase On TomCat - Class not found error

I'm trying to connect to HBASE using tomcat and encountered the following error. When I run the Hbase standlone its working fine.

 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

Below is the xml configuration path

  <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>              

Upvotes: 1

Views: 311

Answers (2)

Tariq
Tariq

Reputation: 34184

Copy the hbase-*.jar inside tomcat's lib directory and try a re-run.

Upvotes: 0

Keerthivasan
Keerthivasan

Reputation: 12880

The exception clearly says that class org.apache.hadoop.hbase.filter.Filter is not found in the classpath. Please add hbase-X.X.X.jar to the class path of the application in tomcat. Please ensure that you use the correct version of hbase jar file.

Upvotes: 2

Related Questions