hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schulze, Dean (Contractor)" <Dean_Schu...@cable.comcast.com>
Subject RE: Unit test can't resolve org.apache.hadoop.hbase.client.Table
Date Tue, 14 Apr 2015 20:52:14 GMT
That solves one problem, but now I get this:

java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/MiniDFSCluster

That class is in project in mysql-connector-java-5.1.12.jar, which doesn't seem right for
an in-memory test of HBase.

Do I need to add a test-jar or something else in the test scope?


-----Original Message-----
From: Ted Yu [mailto:yuzhihong@gmail.com] 
Sent: Tuesday, April 14, 2015 2:26 PM
To: user@hbase.apache.org
Subject: Re: Unit test can't resolve org.apache.hadoop.hbase.client.Table

Please add dependency on hbase-client module where Table resides.

Cheers

On Tue, Apr 14, 2015 at 1:18 PM, Schulze, Dean (Contractor) < Dean_Schulze@cable.comcast.com>
wrote:

> I'm using HBaseTestingUtility in a Junit test.  It compiles, but when 
> I run the test (either from the command line or from Eclipse) it gives 
> the error below:
>
> java.lang.Error: Unresolved compilation problem:
>                 The type org.apache.hadoop.hbase.client.Table cannot 
> be resolved. It is indirectly referenced from required .class files
>
>
> Does this indicate that the transitive dependencies are incorrect?  
> Here are my mvn dependency and code:
>
>                 <dependency>
>                                 <groupId>org.apache.hbase</groupId>
>                                 <artifactId>hbase-server</artifactId>
>                                 <version>1.0.0</version>
>                 </dependency>
>                     <dependency>
>
> <groupId>org.apache.hbase</groupId>
>                                 <artifactId>hbase-server</artifactId>
>                                 <version>1.0.0</version>
>                                 <type>test-jar</type>
>                 </dependency>
>
>
> private static HBaseTestingUtility utility;
>
>                 @Before
>                 public void setUp() throws Exception {
>                                 utility = new HBaseTestingUtility();
>                                 utility.startMiniCluster();
>                 }
>
>                 @Test
>                 public void test() {
>
>                                 try {
>                                                 HTableInterface table 
> = utility.createTable(Bytes.toBytes("TestTable"), TestCF);
>
>                                                 ....
>
>
Mime
View raw message