Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B98E0DE4E for ; Wed, 1 Aug 2012 22:17:35 +0000 (UTC) Received: (qmail 7650 invoked by uid 500); 1 Aug 2012 22:17:35 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 7446 invoked by uid 500); 1 Aug 2012 22:17:35 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Delivered-To: moderator for dev@hbase.apache.org Received: (qmail 39803 invoked by uid 99); 1 Aug 2012 21:48:09 -0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jilani2423@gmail.com designates 209.85.213.169 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=P62iH8yaHv6V2gPCdEsjso2Qwz7NT+IBqw9nzW+Fx68=; b=TMmy/A3cS/BHCzFgRa1t6rBBTgegU2xbnSO2r9/jhBH3M2t54YLU0VMbL2rxnJ1e4G vI8j5Bn1GPElFow/5TcFLnMmbvR0/X92PXBquUEsQNIM8nCm4ILPf7Q/zNrEzi2cKttk SXiGQ1zOF+lGqadHdxdBtNDPZLeATBsN5dCZ9ABsr97fJS2asW6e9zUoAhro8vbEsjNt t8WvFSsjao6BzTdlYU7AhW97vZe/H0u3nEv62kOPR5IC6wKu9HYcV1nddyhlNmtJD/x6 47HR4HsFJZKzZHDU/eWu0YFaWg3vy6P93ckMvf99l33Bdna/HicjpJZUAMRo8q4rQOW7 +43Q== MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 1 Aug 2012 17:47:42 -0400 Message-ID: Subject: Re: Not connecting to HBase using Java from web application From: Jilani Shaik To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=f46d042fdc0897760804c63b3e1d X-Virus-Checked: Checked by ClamAV on apache.org --f46d042fdc0897760804c63b3e1d Content-Type: text/plain; charset=ISO-8859-1 Hi, I am getting one security exception in Java console application but still it is giving me the required outputs like connecting to HBase and getting data from HBase table etc. Where as in ear may be it is not connecting to the Hbase. When I used the debug mode It is coming out from the below line of code HBaseAdmin hbase = new HBaseAdmin(conf); Please see the below output from my console for the same 12/08/01 17:41:11 WARN client.ZooKeeperSaslClient: SecurityException: java.lang.SecurityException: Unable to locate a login configuration occurred when trying to find JAAS configuration. 12/08/01 17:41:11 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration. 12/08/01 17:41:11 INFO zookeeper.ClientCnxn: Socket connection established to systemName/10.0.100.90:2181, initiating session 12/08/01 17:41:11 INFO zookeeper.ClientCnxn: Session establishment complete on server systemName/10.0.100.90:2181, sessionid = 0x138c9dba4c7004d, negotiated timeout = 10000 Demo.main() i: 0columnDescriptors[i] {NAME => 'account', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} Demo.main() i: 1columnDescriptors[i] {NAME => 'personal', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} Thank You, Jilani On Wed, Aug 1, 2012 at 5:22 PM, Jilani Shaik wrote: > Hi, > > We have a linux instance for HBase. Now I am trying to connect to HBase > using Java, when I tried using a simple program it is connecting to HBase > and doing the the operations like create and get the table rows etc. But > the same code I used in my application as a ear file and deployed its not > running. I am not getting any exceptions also. Even I tried for > RuntimeException catching to know the problem. But still not getting the > exceptions. > > Please help me in resolving this issue. > > Please see the below code snippet which is running as a Java console > application. > > Configuration conf = HBaseConfiguration.create(); > //conf.set("hbase.zookeeper.quorum", "10.0.100.90"); // this property > added in the hbase-site.xml > conf.addResource(new > Path("C:/jilani/workspace/hbaseproj1/src/com/demo/hbase/hbase-site.xml")); > > HBaseAdmin hbase = new HBaseAdmin(conf); > // will create a table > HTableDescriptor desc = new HTableDescriptor("demo1"); > HColumnDescriptor meta = new HColumnDescriptor("personal".getBytes()); > HColumnDescriptor prefix = new HColumnDescriptor("account".getBytes()); > desc.addFamily(meta); > desc.addFamily(prefix); > hbase.createTable(desc); > hbase.close(); > // will create a table > > The same code I have used in Java file but it is packaged as jar under ear > for my application. The ear and app server both on the same box where the > java console application running. But its not working. > > Thank You, > Jilani > --f46d042fdc0897760804c63b3e1d--