My hbase java code to create table
public class CreateTable {
public static void main( String args[] ) throws IOException {
HBaseConfiguration hc = new HBaseConfiguration( new Configuration( ) );
HTableDescriptor ht = new HTableDescriptor( "cdrs" );
ht.addFamily( new HColumnDescriptor( "number:" ) );
ht.addFamily( new HColumnDescriptor( "company:" ) );
ht.addFamily( new HColumnDescriptor( "time:" ) );
ht.addFamily( new HColumnDescriptor( "location:" ) );
HBaseAdmin hba = new HBaseAdmin( hc );
System.out.println( "creating table..." );
hba.createTable( ht );
System.out.println( "done!" );
}
running the jar of the code i am getting :- hadoop jar hbase-0.0.1-SNAPSHOT.jar apache.hbase.CreateTable
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop /hbase/HBaseConfiguration
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:227)
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
i am new to hadoop and hbase and facing problem to run this jar from past several days ..any help would be appreciated