Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2972

Running commands from the hadoop-mapreduce-test-*.jar fails with ClassNotFoundException: junit.framework.TestCase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • None
    • mrv2
    • None

    Description

      Running any of the 'hadoop jar hadoop-mapreduce-test-*.jar' commands gives the following exception:

      java.lang.NoClassDefFoundError: junit/framework/TestCase
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      at org.apache.hadoop.test.MapredTestDriver.<init>(MapredTestDriver.java:59)
      at org.apache.hadoop.test.MapredTestDriver.<init>(MapredTestDriver.java:53)
      at org.apache.hadoop.test.MapredTestDriver.main(MapredTestDriver.java:118)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:189)
      Caused by: java.lang.ClassNotFoundException: junit.framework.TestCase
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 21 more

      This happens even when just running 'hadoop jar $TEST_JAR' where it should just print the available commands.
      Copying the junit-*.jar from $HADOOP_MAPRED_HOME/lib/ to $HADOOP_COMMON_HOME/share/hadoop/common/lib/ seems to fix the problem.

      Attachments

        Issue Links

          Activity

            People

              naisbitt Jeffrey Naisbitt
              naisbitt Jeffrey Naisbitt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: