Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 14723 invoked from network); 26 Mar 2010 23:44:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Mar 2010 23:44:07 -0000 Received: (qmail 99343 invoked by uid 500); 26 Mar 2010 23:44:06 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 99282 invoked by uid 500); 26 Mar 2010 23:44:06 -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 99274 invoked by uid 99); 26 Mar 2010 23:44:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Mar 2010 23:44:06 +0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=AWL,FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of vpuranik@gmail.com designates 209.85.222.184 as permitted sender) Received: from [209.85.222.184] (HELO mail-pz0-f184.google.com) (209.85.222.184) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Mar 2010 23:44:00 +0000 Received: by pzk14 with SMTP id 14so3204995pzk.31 for ; Fri, 26 Mar 2010 16:43:39 -0700 (PDT) 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:received:message-id:subject:from:to:content-type; bh=17ocyaj6cj/YDcYzuzRg0fyg7rJ50S+G7ys3euqPqNQ=; b=SumYg4H88+TgXnEPc7adOKCpNQ2ivIYMKjhqj5fFUKj4tEv8ukW5yfbaMNf4HWuGQR twcibirE7H2yc95+vtuF+ElqTRTBCLj5JckzCuLRCKkMxQUJwmi2HilYgOFQxtWO8XQy pnmlKpfLjmC9cAE0JylEYbl9WTHrj0xgvTcpg= 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=syLS5ip065AAQJ+4uG627abLAIiq6ClgWimJLWBnJ+Mz65k3qz0NIqB2gkZ8GIxy7j XcjWcikpVOHh4yk6OXI1fmfI6hXU+lqScmxPxN9AWSqa6ARWkjcOxz8xFQ0Vak4K3GCX oLQ/XmeQaN7gOJXseX+6HaxrHkBY1QpVQt82I= MIME-Version: 1.0 Received: by 10.114.202.14 with HTTP; Fri, 26 Mar 2010 16:43:39 -0700 (PDT) In-Reply-To: References: <419328471003260721q4e626b53u950c4395b0f63c5b@mail.gmail.com> <29bed2721003260727m74022439h5d586a425cdd0368@mail.gmail.com> <419328471003260742h954c4bdrb2caee3c41843b65@mail.gmail.com> <96c64fa81003260801x1501e919ga3743bf44717fef0@mail.gmail.com> <419328471003260954g5eb91882p14125f4c9ba09507@mail.gmail.com> Date: Fri, 26 Mar 2010 16:43:39 -0700 Received: by 10.114.11.1 with SMTP id 1mr2090092wak.52.1269647019794; Fri, 26 Mar 2010 16:43:39 -0700 (PDT) Message-ID: <2eef7bd71003261643j70063b26k276dab7433a331d8@mail.gmail.com> Subject: Re: Connecting from Tomcat to remote HBase From: Vaibhav Puranik To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=00504502eae09ae2330482bcbb98 --00504502eae09ae2330482bcbb98 Content-Type: text/plain; charset=ISO-8859-1 We have hbase in production with the client running fine in tomcat. Here is the POM we use for our hbse jar: 4.0.0 org.apache hbase 0.20.2 HBase 0.20.2 Release org.apache zookeeper 3.2.1 org.apache hadoop 0.20.1-hdfs127-core log4j log4j 1.2.15 Regards, Vaibhav Puranik Gumgum On Fri, Mar 26, 2010 at 4:28 PM, Karthik K wrote: > On Fri, Mar 26, 2010 at 9:54 AM, A Levine wrote: > > > Just to confirm, in the running webapp, the WEB-INF/lib/ directory > > needs to contain: > > > > hbase-0.20.3.jar > > zookeeper-3.2.2.jar > > hadoop-0.20.2.jar > > hbase-default.xml > > hbase-site.xml > > > > Having the files in the WEB-INF/lib/ directory will enable connections > > out to a remote HBase. Is this correct? Or is there more needed? > > > > log4j might be needed, but might be moot because tomcat might already > include it. (under the assumption that you use the hbase client java > library). > > if you are using thrift / rest , you might need more libraries as well. > > > > > > > > > > andrew > > > > -- > > > > On Fri, Mar 26, 2010 at 11:01 AM, George Stathis > > wrote: > > > You will need the hadoop-core jar in the classpath. HBaseConfiguration > > > extends Configuration which is in the hadoop source. You will also need > > the > > > Zookeeper jar that's included in the HBase distro. I have a Maven > project > > > and I had to manually add the jars to my local repository. The tree > Jars > > > that I needed to add for everything to work were: > > > > > > [...] > > > [INFO] | +- org.apache.hadoop:hbase:jar:0.20.3:compile > > > [INFO] | +- org.apache.hadoop:hadoop-core:jar:0.20.2:compile > > > [INFO] | +- org.apache.hadoop:zookeeper:jar:3.2.2:compile > > > [...] > > > > > > Hope this helps. > > > > > > -GS > > > > > > On Fri, Mar 26, 2010 at 10:42 AM, A Levine wrote: > > > > > >> Yes: > > >> > > >> $> ls -1 WEB-INF/lib/ > > >> geoapi-2.3-M1.jar > > >> gt-metadata-2.6.0.jar > > >> gt-referencing-2.6.0.jar > > >> hbase-0.20.3.jar > > >> hbase-default.xml > > >> hbase-site.xml > > >> > > >> andrew > > >> > > >> -- > > >> > > >> On Fri, Mar 26, 2010 at 10:27 AM, Guilherme Germoglio > > >> wrote: > > >> > Are the hbase jars in your webapp's libs directory? You might need > > them. > > >> > > > >> > On Fri, Mar 26, 2010 at 11:21 AM, A Levine > > wrote: > > >> > > > >> >> I am having the hardest time tying to connect from a running webapp > > in > > >> >> Tomcat 6.0 to a remote HBase instance. Whenever the webapp comes > to: > > >> >> > > >> >> HBaseConfiguration config = new HBaseConfiguration(); > > >> >> > > >> >> There is an error reported: > > >> >> > > >> >> java.lang.NoClassDefFoundError: Could not initialize class > > >> >> org.apache.hadoop.hbase.HBaseConfiguration > > >> >> > > >> >> I can connect to a remote HBase from a stand alone program by > setting > > >> >> the classpath to /devel/hbase/conf without any issues. However, > when > > >> >> the code is used in the running webapp, the HBaseConfiguration > cannot > > >> >> be initialized. I know the hbase-default.xml and hbase-site.xml > need > > >> >> to be in the CLASSPATH of the webapp so ClassLader can be called > for > > >> >> both xml files. Those places are: > > >> >> > > >> >> /WEB-INF/classes/ > > >> >> /WEB-INF/lib/*.jar > > >> >> $CATALINA_HOME/lib > > >> >> $CATALINA_HOME/*.jar > > >> >> > > >> >> I have put both files in the /WEB-INF/classes/ directory with no > > >> >> success. What am I doing wrong? > > >> >> > > >> >> andrew > > >> >> > > >> > > > >> > > > >> > > > >> > -- > > >> > Guilherme > > >> > > > >> > msn: guigermoglio@hotmail.com > > >> > homepage: http://sites.google.com/site/germoglio/ > > >> > > > >> > > > > > > --00504502eae09ae2330482bcbb98--