AnsweredAssumed Answered

HBase Java API: java.lang.NoClassDefFoundError

Question asked by tc_dev on Mar 9, 2012
Latest reply on Mar 9, 2012 by tc_dev
I am prototyping a Java/Maven project that needs to directly access HBase. HBase installed successfully and I created tables via shell using examples in the documentation.

I am able to run "mvn package" to build my project, however when trying to run it the HBase class loading always fails. I isolated the problem by simplifying the failing line / exception -

        ClassLoader loader = HBaseConfiguration.class.getClassLoader();

Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.hadoop.hbase.HBaseConfiguration 

This seems wrong since I believe CLASSPATH is set correctly before running the project -

export HADOOP\_CLASSPATH=\`hadoop classpath\` 
export HBASE\_CLASSPATH=\`/opt/mapr/hbase/hbase-0.90.4/bin/hbase classpath\` 
java -cp target/my-app-1.0-SNAPSHOT.jar

Here is the dependency section from my pom.xml



Why is my code failing? The dependencies worked at compile time...