Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> connecting Hbase using java


+
Alok Singh Mahor 2013-03-30, 14:02
+
Ted Yu 2013-03-30, 14:49
+
Mohammad Tariq 2013-03-30, 15:25
+
Stephen Boesch 2013-03-30, 15:29
+
Alok Singh Mahor 2013-03-31, 03:00
+
Ted Yu 2013-03-31, 03:39
+
Alok Singh Mahor 2013-03-31, 10:48
+
Ted Yu 2013-03-31, 14:37
+
Alok Singh Mahor 2013-03-31, 16:46
+
Ted Yu 2013-03-31, 19:04
+
Alok Singh Mahor 2013-03-31, 20:51
Copy link to this message
-
Re: connecting Hbase using java
Hi all,
today I start afresh a Example code on
http://blog.rajeevsharma.in/2009/06/using-hbase-in-java-0193.html
but I guess luck is not with me.
I run
javac -classpath
~/packages/hbase-0.94.6/hbase-0.94.6.jar:~/packages/hbase-0.94.6/lib/*:~/packages/hadoop-1.1.2/*.jar:~/packages/hadoop-1.1.2/lib/*.jar
HBaseExample.java -verbose

please tell me what else I need to add in path to resolve these errors

thank you
alok@alok:~/exp/hbase/exp$ javac -classpath
~/packages/hbase-0.94.6/hbase-0.94.6.jar:~/packages/hbase-0.94.6/lib/*:~/packages/hadoop-1.1.2/*.jar:~/packages/hadoop-1.1.2/lib/*.jar
HBaseExample.java -verbose
[parsing started RegularFileObject[HBaseExample.java]]
[parsing completed 29ms]
[search path for source files:
/home/alok/packages/hbase-0.94.6/hbase-0.94.6.jar,~/packages/hbase-0.94.6/lib/*,~/packages/hadoop-1.1.2/*.jar,~/packages/hadoop-1.1.2/lib/*.jar]
[search path for class files:
/usr/lib/jvm/java-7-openjdk-i386/jre/lib/resources.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/sunrsasign.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jsse.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jce.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/charsets.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/netx.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/plugin.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rhino.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jfr.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/classes,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/zipfs.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/sunjce_provider.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/sunpkcs11.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/pulse-java.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/dnsns.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/java-atk-wrapper.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/localedata.jar,/home/alok/packages/hbase-0.94.6/hbase-0.94.6.jar,~/packages/hbase-0.94.6/lib/*,~/packages/hadoop-1.1.2/*.jar,~/packages/hadoop-1.1.2/lib/*.jar]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/io/IOException.class)]]
HBaseExample.java:2: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.Path;
                           ^
[loading
ZipFileIndexFileObject[/home/alok/packages/hbase-0.94.6/hbase-0.94.6.jar(org/apache/hadoop/hbase/HBaseConfiguration.class)]]
[loading
ZipFileIndexFileObject[/home/alok/packages/hbase-0.94.6/hbase-0.94.6.jar(org/apache/hadoop/hbase/client/HTable.class)]]
HBaseExample.java:5: error: cannot find symbol
import org.apache.hadoop.hbase.client.Scanner;
                                     ^
  symbol:   class Scanner
  location: package org.apache.hadoop.hbase.client
HBaseExample.java:6: error: cannot find symbol
import org.apache.hadoop.hbase.io.BatchUpdate;
                                 ^
  symbol:   class BatchUpdate
  location: package org.apache.hadoop.hbase.io
HBaseExample.java:7: error: cannot find symbol
import org.apache.hadoop.hbase.io.Cell;
                                 ^
  symbol:   class Cell
  location: package org.apache.hadoop.hbase.io
HBaseExample.java:8: error: cannot find symbol
import org.apache.hadoop.hbase.io.RowResult;
                                 ^
  symbol:   class RowResult
  location: package org.apache.hadoop.hbase.io
[loading
ZipFileIndexFileObject[/home/alok/packages/hbase-0.94.6/hbase-0.94.6.jar(org/apache/hadoop/hbase/util/Bytes.class)]]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/String.class)]]
[checking HBaseExample]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Exception.class)]]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Throwable.class)]]
HBaseExample.java:16: error: cannot find symbol
        conf.addResource(new Path("/opt/hbase-0.19.3/conf/hbase-site.xml"));
                             ^
  symbol:   class Path
  location: class HBaseExample
HBaseExample.java:16: error: cannot access Configuration
        conf.addResource(new Path("/opt/hbase-0.19.3/conf/hbase-site.xml"));
            ^
  class file for org.apache.hadoop.conf.Configuration not found
HBaseExample.java:20: error: cannot find symbol
        BatchUpdate batchUpdate = new BatchUpdate("test_row1");
        ^
  symbol:   class BatchUpdate
  location: class HBaseExample
HBaseExample.java:20: error: cannot find symbol
        BatchUpdate batchUpdate = new BatchUpdate("test_row1");
                                      ^
  symbol:   class BatchUpdate
  location: class HBaseExample
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/math/BigDecimal.class)]]
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/nio/ByteBuffer.class)]]
HBaseExample.java:25: error: cannot find symbol
        Cell cell = table.get("test_row1", "columnfamily1:column1");
        ^
  symbol:   class Cell
  location: class HBaseExample
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/util/List.class)]]
HBaseExample.java:25: error: no suitable method found for get(String,String)
        Cell cell = table.get("test_row1", "columnfamily1:column1");
                         ^
    method HTable.get(List<Get>) is not applicable
      (actual and formal argument lists differ in length)
    method HTable.get(Get) is not applicable
      (actual and formal argument lists differ in length)
[loading
ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/S
+
Andrea Gazzarini 2013-04-03, 16:59
+
Harsha 2013-04-03, 21:20
+
Alok Singh Mahor 2013-04-03, 23:03
+
Jean-Marc Spaggiari 2013-04-04, 00:24
+
Alok Singh Mahor 2013-04-04, 09:04
+
Jean-Marc Spaggiari 2013-04-04, 12:06
+
Alok Singh Mahor 2013-04-04, 13:13
+
Jean-Marc Spaggiari 2013-04-04, 13:38
+
Alok Singh Mahor 2013-04-04, 14:37
+
Jean-Marc Spaggiari 2013-04-04, 14:41
+
Alok Singh Mahor 2013-04-04, 14:50
+
Jean-Marc Spaggiari 2013-04-04, 15:13
+
Alok Singh Mahor 2013-04-05, 03:38
+
Jean-Marc Spaggiari 2013-04-05, 11:47
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB