Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 73221 invoked from network); 20 Feb 2009 21:42:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2009 21:42:45 -0000 Received: (qmail 53646 invoked by uid 500); 20 Feb 2009 21:42:44 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 53624 invoked by uid 500); 20 Feb 2009 21:42:44 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 53613 invoked by uid 99); 20 Feb 2009 21:42:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 13:42:44 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amansk@gmail.com designates 209.85.217.170 as permitted sender) Received: from [209.85.217.170] (HELO mail-gx0-f170.google.com) (209.85.217.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 21:42:37 +0000 Received: by gxk18 with SMTP id 18so3022690gxk.5 for ; Fri, 20 Feb 2009 13:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=js1BqiRHYp9oNhexQGzBKD9QaDalcheUoaxPzCy6XJM=; b=oTEodWaw0E71nV3AxswWoxt+bkJmLGngbnqNjE1xsP6fgMEMUIILMX2ZPF/Ckq2j/G Vw0CxiOLtDZni4+piyLGUQZ73aMz1TuzsVivvX/KoLbnrPOJi/VCMmz6+TMPKFum2yHh jMedZoXE3Bp1oeMXlOnBUYOMKMXFSUqI2FtXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=aKe1NiwcxqP2Gb44FLyNr6K+pW04kRNIQPYek//NxTtJl9/h6DdJC1PHS3l57muaeL OAfPHxRVqafyJC+cmg9NvKBEDChZVM3QPTBFhO30Y5VdUoYJeevY9GDF2puJ73zLFbAb wuRyXWLx2DV9oAD4eiuPKzC+gdsugPfe790N4= MIME-Version: 1.0 Received: by 10.231.20.5 with SMTP id d5mr1532953ibb.25.1235166136055; Fri, 20 Feb 2009 13:42:16 -0800 (PST) In-Reply-To: <35a22e220902201319p3aeb73ecndaea8436fe0830b4@mail.gmail.com> References: <35a22e220902201319p3aeb73ecndaea8436fe0830b4@mail.gmail.com> Date: Fri, 20 Feb 2009 13:42:16 -0800 Message-ID: <35a22e220902201342r427ec616yf39ee355238eae27@mail.gmail.com> Subject: Re: Reading from hbase From: Amandeep Khurana To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=000325575a36c739fa0463608688 X-Virus-Checked: Checked by ClamAV on apache.org --000325575a36c739fa0463608688 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Figured it out. It was a jre problem. I was using 1.5 whereas this 0.19 hbase version needed 1.6. Amandeep Amandeep Khurana Computer Science Graduate Student University of California, Santa Cruz On Fri, Feb 20, 2009 at 1:19 PM, Amandeep Khurana wrote: > I am a new Hbase user and am trying to figure my way around with the > framework. > > I was able to get the cluster going and used map reduce to enter data into > it. Now, I need to access the table from a java program from a client > machine. How can I do that? I tried setting the hbase.master value in the > configuration to the server:port of the hbase master, but that didnt work. I > added the default.xml and site.xml files as resources in the > HBaseConfiguration object, that didnt work either. > > This is the error I am getting: > > Exception in thread "main" java.lang.IllegalStateException > at java.nio.charset.CharsetEncoder.encode(libgcj.so.90) > at org.apache.hadoop.io.Text.encode(Text.java:388) > at org.apache.hadoop.io.Text.encode(Text.java:369) > at org.apache.hadoop.io.Text.writeString(Text.java:409) > at > org.apache.hadoop.hbase.io.HbaseObjectWritable.writeObject(HbaseObjectWritable.java:265) > at > org.apache.hadoop.hbase.ipc.HBaseRPC$Invocation.write(HBaseRPC.java:156) > at > org.apache.hadoop.hbase.ipc.HBaseClient$Connection.sendParam(HBaseClient.java:472) > at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:691) > at > org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:321) > at $Proxy1.getProtocolVersion(Unknown Source:0) > at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:467) > at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:443) > at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:491) > at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:407) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.getHRegionConnection(HConnectionManager.java:724) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRootRegion(HConnectionManager.java:773) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:448) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:423) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:498) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:457) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:423) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:498) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:461) > at > org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:423) > at org.apache.hadoop.hbase.client.HTable.(HTable.java:114) > at org.apache.hadoop.hbase.client.HTable.(HTable.java:97) > at Client.main(Client.java:21) > > What am I doing wrong? > > Here's my code for accessing the table: > HBaseConfiguration config = new HBaseConfiguration(); > config.set("hbase.master", "rndpc0:60000"); > // config.addResource(new > Path("/hadoop/install/hbase/conf/hbase-default.xml")); > // config.addResource(new > Path("/hadoop/install/hbase/conf/hbase-site.xml")); > HTable table = new HTable(config, "sunm"); > Cell cell = table.get("842", "disruption:"); > String valueStr = Bytes.toString(cell.getValue()); > System.out.println(valueStr); > > > Amandeep > > > > Amandeep Khurana > Computer Science Graduate Student > University of California, Santa Cruz > --000325575a36c739fa0463608688--