The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

Hortonworks Sandbox Forum

HBaseTestingUtility based tests fail in HDP 2.0 sandbox

  • #36772

    We are currently evaluating HortonWorks HDP 2.0 & testing our existing project in sandbox environment. However, all unit tests in our project using HBaseTestingUtility fails. The logs are not useful and looking through the test cluster’s logs, we found the following exception:

    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce/v2/app/MRAppMaster
    Caused by: java.lang.ClassNotFoundException:
    Could not find the main class: Program will exit.

    The suggestions for this error were adding environment variables to user’s profile. I tried the same by editing both as well as /etc/profile, but same error persists.
    I also followed some of the patches being discussed in the Apache mailing list and tried the same in our test suite. The main ones being:
    *Setting “” as “true”
    *Setting “yarn.application.classpath” to System.getProperty(“java.class.path”)
    *Adding the following code: TableMapReduceUtil.addDependencyJars(job);

    I tried each one of them separately and in combination as well. In all cases, the error message has changed to indicate a different YARN exception, but the test continues to fail. The underlying exception that causes the test job to fail:

    ERROR [main] org.apache.hadoop.yarn.YarnUncaughtExceptionHandler: Thread Thread[main,5,main] threw an Exception.
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.hadoop.util.ReflectionUtils.newInstance(
    at org.apache.hadoop.mapred.YarnChild.main(
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at java.lang.reflect.Constructor.newInstance(
    at org.apache.hadoop.util.ReflectionUtils.newInstance(
    … 5 more
    Caused by: java.lang.UnsatisfiedLinkError:
    at Method)
    … 10 more

    Any pointers to fixing the error is greatly appreciated.

    java version “1.6.0_31”
    Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

  • Author
  • #37037

    FWIW, this error happens only when using “startMiniMapReduceCluster()” and not “startMiniDFSCluster()” or “startMiniZKCluster()”.

    Cheryle Custer


    Are you running the HDP 2.0 Community Preview? If so, we’ve just released the HDP 2.0 Beta Sandbox. You can download it here:


    Thanks Cheryle. Yes we are running the HDP 2.0 Community Preview. Is this a known bug in that version? Please let me know. I will anyway download and try the HDP 2.0 Beta Sandbox.

The forum ‘Hortonworks Sandbox’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.