Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

maven - org.apache.hadoop.conf.Configuration does not exist in hadoop-core.jar

I am writing an HBase client in Java. The first line, of coz, looks like this:

import org.apache.hadoop.conf.Configuration;

I am using Cloudera CDH4.3.1, so the package versions should be:

hadoop-2.0.0+1367
hbase-0.94.6+106

==Updated==

my pom.xml looks like this:

<dependency>
  <groupId>org.apache.hadoop</groupId>
  <artifactId>hadoop-core</artifactId>
  <version>2.0.0-mr1-cdh4.3.1</version>
</dependency>


<dependency>
  <groupId>org.apache.hbase</groupId>
  <artifactId>hbase</artifactId>
  <version>0.94.6-cdh4.3.1</version>
</dependency>

But somehow, in hadoop-core.jar, I am not seeing any existence of org.apache.hadoop.conf.Configuration. As the result of it, the import is not resolved by Java obviously.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Add hadoop-common to your pom.xml

<dependency>                                                                                                                                       
    <groupId>org.apache.hadoop</groupId>                                                                                                           
    <artifactId>hadoop-common</artifactId>                                                                                                         
    <version>2.0.0-cdh4.3.1</version>                                                                                            
</dependency>   

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...