<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Trying to run simple Java Hbase program w Eclipse in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6931#M1212</link>
    <description>&lt;P&gt;Oh ok, thanks for clarifying. &amp;nbsp;Yes, you can most certainly develop and test apps in Ecplise. &amp;nbsp;In fact, there is a blog post and video tutorial on that exact process posted in &lt;A href="https://community.cloudera.com/t5/Apache-Hadoop-Concepts-and/Build-your-own-MapReduce-jobs-with-Eclipse-and-the-Quickstart-VM/m-p/107#U107" target="_self"&gt;this thread&lt;/A&gt;. &amp;nbsp;I bet that'll get you the help you need, but please let us know if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2014 13:11:03 GMT</pubDate>
    <dc:creator>Clint</dc:creator>
    <dc:date>2014-02-28T13:11:03Z</dc:date>
    <item>
      <title>Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6853#M1209</link>
      <description>&lt;P&gt;I'm able to run simple 'create' and 'put' to add data to rows (I'm using HBase - the Definitive Guide) but it's failing when I try to run the Java program shown below:&lt;/P&gt;&lt;PRE&gt;import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.IOException;

public class PutExample {
   public static void main(String[] args) throws IOException {
      Configuration conf = HBaseConfiguration.create();
      HTable table = new HTable(conf, "jptesttable");
      Put put = new Put(Bytes.toBytes("row1"));
      put.add(Bytes.toBytes("colfam1"),Bytes.toBytes("qual1"),Bytes.toBytes("val1"));
      put.add(Bytes.toBytes("colfam1"),Bytes.toBytes("qual2"),Bytes.toBytes("val2"));

      table.put(put);
      table.close();
   }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I'm pretty sure I have all the libraries I need (plus some I don't need):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; hbase.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; commons-logging-1.1.1.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; log4j-1.2.17.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; zookeeper.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; commons-lang-2.5.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; commons-configuration-1.6.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; slf4j-api-1.6.1.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; slf4j-log4j12-1.6.1.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; hadoop.core.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; core.3.1.1.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; hadoop.common-2.0.0-cdh4.1.1.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; hbase-0.92.1-cdh4.1.1-security.jar&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; usr/lib/hbase/conf &amp;nbsp; in the path&lt;/P&gt;&lt;P&gt;I haven't changed the hbase.site.xml file:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;!-- Changing the default port for REST since it conflicts with yarn nodemanager  --&amp;gt;
  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;hbase.rest.port&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;8070&amp;lt;/value&amp;gt;
    &amp;lt;description&amp;gt;The port for the HBase REST server.&amp;lt;/description&amp;gt;
  &amp;lt;/property&amp;gt;
  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;hbase.rootdir&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;hdfs://localhost:8020/hbase&amp;lt;/value&amp;gt;
  &amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;=&amp;gt; Is there anything I can do to get this to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the error log,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps&lt;BR /&gt;at org.apache.hadoop.metrics2.lib.MetricsRegistry.&amp;lt;init&amp;gt;(MetricsRegistry.java:42)&lt;BR /&gt;at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.&amp;lt;init&amp;gt;(MetricsSystemImpl.java:87)&lt;BR /&gt;at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.&amp;lt;init&amp;gt;(MetricsSystemImpl.java:133)&lt;BR /&gt;at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.&amp;lt;init&amp;gt;(DefaultMetricsSystem.java:38)&lt;BR /&gt;at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.&amp;lt;clinit&amp;gt;(DefaultMetricsSystem.java:36)&lt;BR /&gt;at org.apache.hadoop.security.UserGroupInformation$UgiMetrics.create(UserGroupInformation.java:97)&lt;BR /&gt;at org.apache.hadoop.security.UserGroupInformation.&amp;lt;clinit&amp;gt;(UserGroupInformation.java:190)&lt;BR /&gt;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;BR /&gt;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;BR /&gt;at java.lang.reflect.Method.invoke(Method.java:597)&lt;BR /&gt;at org.apache.hadoop.hbase.util.Methods.call(Methods.java:37)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User.call(User.java:586)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User.callStatic(User.java:576)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User.access$400(User.java:50)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User$SecureHadoopUser.&amp;lt;init&amp;gt;(User.java:393)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User$SecureHadoopUser.&amp;lt;init&amp;gt;(User.java:388)&lt;BR /&gt;at org.apache.hadoop.hbase.security.User.getCurrent(User.java:139)&lt;BR /&gt;at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionKey.&amp;lt;init&amp;gt;(HConnectionManager.java:412)&lt;BR /&gt;at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:182)&lt;BR /&gt;at org.apache.hadoop.hbase.client.HTable.&amp;lt;init&amp;gt;(HTable.java:196)&lt;BR /&gt;at org.apache.hadoop.hbase.client.HTable.&amp;lt;init&amp;gt;(HTable.java:173)&lt;BR /&gt;at PutExample.main(PutExample.java:17)&lt;BR /&gt;Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps&lt;BR /&gt;at java.net.URLClassLoader$1.run(URLClassLoader.java:202)&lt;BR /&gt;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;at java.net.URLClassLoader.findClass(URLClassLoader.java:190)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:306)&lt;BR /&gt;at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:247)&lt;BR /&gt;... 23 more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;jp&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 08:54:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6853#M1209</guid>
      <dc:creator>bigpalooka</dc:creator>
      <dc:date>2022-09-16T08:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6901#M1210</link>
      <description>&lt;P&gt;Try placing the following on the command line before your "hadoop jar...." command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;HADOOP_CLASSPATH=`hbase classpath`&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Which brings up a good point, you ARE running your program with the syntax "hadoop jar /path/to/your/jar className..." right?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2014 22:36:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6901#M1210</guid>
      <dc:creator>Clint</dc:creator>
      <dc:date>2014-02-27T22:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6917#M1211</link>
      <description>I'm trying to run it through the IDE (Eclipse) - just running the program in Debug mode.&lt;BR /&gt;In my search for answers, I'm only seeing questions from people running from the command line.&lt;BR /&gt;Can I test from the Eclipse IDE, or will my testing have to be from jar files at the command line?</description>
      <pubDate>Fri, 28 Feb 2014 02:17:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6917#M1211</guid>
      <dc:creator>bigpalooka</dc:creator>
      <dc:date>2014-02-28T02:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6931#M1212</link>
      <description>&lt;P&gt;Oh ok, thanks for clarifying. &amp;nbsp;Yes, you can most certainly develop and test apps in Ecplise. &amp;nbsp;In fact, there is a blog post and video tutorial on that exact process posted in &lt;A href="https://community.cloudera.com/t5/Apache-Hadoop-Concepts-and/Build-your-own-MapReduce-jobs-with-Eclipse-and-the-Quickstart-VM/m-p/107#U107" target="_self"&gt;this thread&lt;/A&gt;. &amp;nbsp;I bet that'll get you the help you need, but please let us know if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 13:11:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6931#M1212</guid>
      <dc:creator>Clint</dc:creator>
      <dc:date>2014-02-28T13:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6985#M1213</link>
      <description>&lt;P&gt;Thanks. &amp;nbsp;I used the excellent video and blog (and my Cloudera Academic Training notes) to run Hadoop MR scenarios as jar files and through Eclipse. &amp;nbsp;Very happy.&lt;/P&gt;&lt;P&gt;I haven't been successful in running the hbase java program I listed earlier, or the MakeTable example included in the hbase directory. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Configuration issues? &amp;nbsp;(I'm using the out-of-the-box configuration.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[training@localhost java]$ javac -classpath `hbase classpath` MakeTable.java
[training@localhost java]$ jar cvf MakeTable.jar MakeTable.class
[training@localhost java]$ hadoop jar MakeTable.jar MakeTable&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;at MakeTable.main(MakeTable.java:24)&lt;BR /&gt;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;BR /&gt;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;BR /&gt;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;BR /&gt;at java.lang.reflect.Method.invoke(Method.java:597)&lt;BR /&gt;at org.apache.hadoop.util.RunJar.main(RunJar.java:208)&lt;BR /&gt;Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration&lt;BR /&gt;at java.net.URLClassLoader$1.run(URLClassLoader.java:202)&lt;BR /&gt;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;at java.net.URLClassLoader.findClass(URLClassLoader.java:190)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:306)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:247)&lt;BR /&gt;... 6 more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;jp&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2014 04:10:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6985#M1213</guid>
      <dc:creator>bigpalooka</dc:creator>
      <dc:date>2014-03-01T04:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6987#M1214</link>
      <description>&lt;P&gt;Was able to run this task:&lt;/P&gt;&lt;PRE&gt;[training@localhost java]$ javac -cp `hbase classpath` MakeTable.java
[training@localhost java]$ java -cp `hbase classpath` MakeTable&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thanks for your help.&lt;/P&gt;&lt;P&gt;jp&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2014 16:03:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6987#M1214</guid>
      <dc:creator>bigpalooka</dc:creator>
      <dc:date>2014-03-01T16:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6991#M1215</link>
      <description>&lt;P&gt;Thanks for the follow up. &amp;nbsp;I was going to suggest that exact thing for command-line, but the part I wasn't clear on was how to get Eclipse to load the HBase jars both during compile time AND runtime. &amp;nbsp;I'm not super familiar with IDE-based development, but that is the key to getting HBase applications to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad you resolved it!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2014 19:44:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6991#M1215</guid>
      <dc:creator>Clint</dc:creator>
      <dc:date>2014-03-01T19:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to run simple Java Hbase program w Eclipse</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6993#M1216</link>
      <description>For anybody who might be following this, I referenced all the libraries referenced in the video and for HBase , added the 2 HBase refs to the reference list (hbase.jar and hbase-0.92.1-cdh4.1.1-security.jar)&lt;BR /&gt;Then it worked in Eclipse.&lt;BR /&gt;-- jp</description>
      <pubDate>Sat, 01 Mar 2014 20:58:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Trying-to-run-simple-Java-Hbase-program-w-Eclipse/m-p/6993#M1216</guid>
      <dc:creator>bigpalooka</dc:creator>
      <dc:date>2014-03-01T20:58:33Z</dc:date>
    </item>
  </channel>
</rss>

