Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Failing to diagnose errors using HBaseTestingUtility


Copy link to this message
-
Failing to diagnose errors using HBaseTestingUtility
I am working on a project that uses HBase and want to develop my unit tests to use the HBaseTestingUtility to test without a separate cluster, but I am running into a lot problems using it. Everything compiles fine, but there my unit tests that try to spin up a cluster blow up:

This is the basic test I am trying to run:

public class PersiaAdminTest {
  private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    TEST_UTIL.startMiniCluster(1);
  }

  @AfterClass
  public static void tearDownAfterClass() throws Exception {
    TEST_UTIL.shutdownMiniCluster();
  }

  @Test
  public void testPersiaAdmin() throws IOException {
    assertTrue(true);
  }
}

My pom.xml has the following dependencies:

  hadoop-core-1.0.0
  hadoop-test-1.0.0
  hbase-0.92.1
  hbase-0.92.1 (test-jar)
  junit-4.10

And the error message I am getting is: (note that when I download the 0.92.1 release tar ball, the unit tests that use HBaseTestingUtility don't have this issue):

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.154 sec <<< FAILURE!
edu.ucsc.srl.persia.PersiaAdminTest  Time elapsed: 6.155 sec  <<< ERROR!
java.io.IOException: Shutting down
at org.apache.hadoop.hbase.MiniHBaseCluster.init(MiniHBaseCluster.java:203)
at org.apache.hadoop.hbase.MiniHBaseCluster.<init>(MiniHBaseCluster.java:76)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniHBaseCluster(HBaseTestingUtility.java:523)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:503)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:451)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:438)
at edu.ucsc.srl.persia.PersiaAdminTest.setUpBeforeClass(PersiaAdminTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:157)
at org.apache.hadoop.hbase.LocalHBaseCluster.addMaster(LocalHBaseCluster.java:198)
at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:148)
at org.apache.hadoop.hbase.MiniHBaseCluster.init(MiniHBaseCluster.java:185)
... 28 more
Caused by: java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.isFullyTyped()Z
at org.codehaus.jackson.map.type.ArrayType.<init>(ArrayType.java:36)
at org.codehaus.jackson.map.type.ArrayType.construct(ArrayType.java:48)
at org.codehaus.jackson.map.type.ArrayType.addCommonTypes(ArrayType.java:78)
at org.codehaus.jackson.map.type.TypeFactory.<init>(TypeFactory.java:43)
at org.codehaus.jackson.map.type.TypeFactory.<clinit>(TypeFactory.java:15)
at org.codehaus.jackson.map.ObjectMapper.<clinit>(ObjectMapper.java:42)
at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.<clinit>(WritableRpcEngine.java:258)
at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:245)
at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getServer(WritableRpcEngine.java:55)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:401)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getServer(HBaseRPC.java:390)
at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:244)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:154)
... 31 more

====Below is the log. It looks like the problem is because the cluster isn't starting up, but I'm still clueless what's wrong.
====
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running edu.ucsc.srl.persia.PersiaAdminTest
12/04/04 12:22:09 INFO hbase.HBaseTestingUtility: Starting up minicluster with 1 master(s) and 1 regionserver(s) and 1 datanode(s)
12/04/04 12:22:09
+
Stack 2012-04-04, 19:51
+
Noah Watkins 2012-04-04, 20:22
+
Stack 2012-04-04, 20:43
+
Noah Watkins 2012-04-04, 20:49
+
Stack 2012-04-04, 20:51
+
Noah Watkins 2012-04-04, 20:53
+
Stack 2012-04-04, 22:17
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB