使用eclipse開發hbase程式時缺少包錯誤

來源:互聯網
上載者:User

標籤:hbase   錯誤   eclipse   

在win上的eclipse進行配置hbase,然後編寫一個簡單的建立表的操作,使用ant的build.xml進行運行報錯:


[sshexec] Connecting to 192.168.60.111:22

  [sshexec] cmd : /opt/hadoop/bin/hadoop jar /home/hadoop_jar/HbaseApp1.jar hbasetest.HbaseApp1

  [sshexec] Exception in thread "main" 

  [sshexec] java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration

  [sshexec] 

  [sshexec] at hbasetest.HbaseApp1.main(Unknown Source)

  [sshexec] 

  [sshexec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  [sshexec] 

  [sshexec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)




但是不使用build時,直接點擊右鍵運行時,沒有報錯:


log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

table exists



解決辦法:

 在hadoop-env.sh檔案中增加如下代碼

  export HADOOP_CLASSPATH=/usr/local/hbase-0.98.8-hadoop2/lib/*


本文出自 “躍躍之鳥” 部落格,請務必保留此出處http://jxplpp.blog.51cto.com/4455043/1652977

使用eclipse開發hbase程式時缺少包錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.