Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 18878 invoked from network); 4 Feb 2009 02:51:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2009 02:51:44 -0000 Received: (qmail 82779 invoked by uid 500); 4 Feb 2009 02:51:43 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 82754 invoked by uid 500); 4 Feb 2009 02:51:43 -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 82743 invoked by uid 99); 4 Feb 2009 02:51:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 18:51:43 -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 saint.ack@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 02:51:36 +0000 Received: by an-out-0708.google.com with SMTP id d14so814178and.29 for ; Tue, 03 Feb 2009 18:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=WvXoRaolnkhSNkUdoDiL3vzUxwlPmC3rReuTXakT8m8=; b=gV9dCBTeISdfMNiZI6RiCszMuJQqOSrfhxV0maELMgpQRYn4t/FQg7Y1qCs6LETzLc oWxKpiO8xS2uTNv9hfj/tOwmrw4hY9FYupWjmwqnFwCwXvJvvXUybCFcUNXzY3Wcg7ES ZIC7/Zt6T6ewemvlHzc4lhTn+03/gDA8MyybE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=a71ymHeB8sZJz9UIwmQDxKANhlJWFUaeISjw8A/roKc5QXosLuH5gmlwJgECseK0SI ShxkQdalMx+Ri1KYgM4MtEYlzH4y7+7TuvDZp0KveBpfIipCyJ7UZfiKERzc9J5zF2ND mO2u7pFSVuuoikeLse7RmWW3IzW+yaYV/39Q8= MIME-Version: 1.0 Sender: saint.ack@gmail.com Received: by 10.100.132.14 with SMTP id f14mr4388731and.107.1233715875563; Tue, 03 Feb 2009 18:51:15 -0800 (PST) In-Reply-To: References: Date: Tue, 3 Feb 2009 18:51:15 -0800 X-Google-Sender-Auth: ca5ac95316bf7b5e Message-ID: <7c962aed0902031851j15d4d1aei390a3c733472819c@mail.gmail.com> Subject: Re: NPE from HConnectionManager From: stack To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=0016e6434bcc844a6904620edc66 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6434bcc844a6904620edc66 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks for updating the list Tom. St.Ack On Mon, Feb 2, 2009 at 10:35 AM, Tom Nichols wrote: > Well after digging (and digging... and digging some more) it turns out > the source of the problem is in the Groovy Ant task. Rather, the fact > that ....hbase.Configuration uses the > Thread.getCurrentThread().getContextClassloader(), which the Groovy > Ant task leaves as the system classpath, as opposed to the classpathref='_____'> value. So none of the HBase JARs were available > to that classloader... Which is why HBase couldn't find > hbase-default.xml or hbase-site.xml. > > > > On Mon, Feb 2, 2009 at 12:07 PM, Tom Nichols wrote: > > Hi, > > > > I am using the HBase client API in from a Groovy script: > > > > import org.apache.hadoop.hbase.HBaseConfiguration > > import org.apache.hadoop.hbase.client.HBaseAdmin > > println new HBaseAdmin( new HBaseConfiguration() ) > > > > The script works fine if run standalone, but if I run it as an embeded > > ant task, I get the following exception: > > > > java.lang.NullPointerException > > at > java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) > > at > org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:90) > > at > org.apache.hadoop.hbase.client.HBaseAdmin.(HBaseAdmin.java:66) > > at > com.enernoc.rnd.shredder.core.groovy.HBaseBuilder.getAdmin(HBaseBuilder.java:530) > > at > com.enernoc.rnd.shredder.core.groovy.HBaseBuilder.create(HBaseBuilder.java:229) > > > > > > Looking into the code: > > 86 : public static HConnection > getConnection(HBaseConfiguration conf) { > > 87 : TableServers connection; > > 88 : synchronized (HBASE_INSTANCES) { > > 89 : String instanceName = conf.get(HBASE_DIR); > > 90 : connection = HBASE_INSTANCES.get(instanceName); > > > > It means that either "instanceName" is null, or HBASE_INSTANCES is > > null. I am guessing it is the former since the previous line is > > retrieving that value. So can anyone guess why this would fail? The > > HBase JAR is on my classpath, which contains the hbase-default.xml > > config file (which has the hbase.rootdir value). > > > > Furthermore, it appears that the value "hbase.rootdir" is a server > > configuration to tell the HBase server where the data is stored -- > > correct? So if I am just using the client api (i.e. to connect to a > > running HBase server instance,) why would the client be attempting to > > directly access the data files rather than going through the server > > connection? Or am I confused about how the HBase API works? > > > > Thanks in advance for the help. > > > > -Tom > > > --0016e6434bcc844a6904620edc66--