Oracle NoSQL Hadoop CountMinorKeys
1005853May 5 2013 — edited May 6 2013I have installed the latest Oracle NoSQL EE-Enterprise Edition 11gR2 (11.2.2.0.39) on my VM running CentOS 6 and CDH4.2 for MRv1 (single node). I have bumped into a different error than previously posted when running CountMinorKeys.java where CountMinorKeys$Map is not recognized as a class.
My run: hadoop jar hadoop2.jar hadoop.CountMinorKeys -libjars kvclient.jar kvstore localhost.localdomain:5000 /MyCountOutput
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: hadoop/CountMinorKeys$Map
at hadoop.CountMinorKeys.run(CountMinorKeys.java:103)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at hadoop.CountMinorKeys.main(CountMinorKeys.java:119)
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:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
Caused by: java.lang.ClassNotFoundException: hadoop.CountMinorKeys$Map
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
I have created the jar files three different ways all to get the same above error message:
1. created jar file via command line
2. created jar file using Oracle's Jdeveloper
3. created jar file using Eclipse on windows and transferred the jar to my VM.
Three classes are created called CountMinorKeys.class, CountMinorKeys$Map.class and CountMinorKeys$Reduce.class. (the CountMinorKeys$Map.class is not being recognized.) Any recommendations? Thank you. (P.S. I am a beginner JAVA programmer and recompiling the Oracle source code would not be an option for me - as noted in previous thread as a workaround.)
I am using jdk= jdk1.7.0_17. The following 3 jar files are needed: (hadoop-common-2.0.0-cdh4.2.0.jar, hadoop-mapreduce-client-core-2.0.0-cdh4.2.0.jar, kvclient.jar) --> note: the hadoop jar files are not noted in the Oracle documentation for running the tutorial. I have the 3 jars located in my /home/cloudera/myjars folder:
echo $HADOOP_CLASSPATH displays:
/home/cloudera/myjars/kvclient.jar:/home/cloudera/myjars/hadoop-common-2.0.0-cdh4.2.0.jar:/home/cloudera/myjars/hadoop-mapreduce-client-core-2.0.0-cdh4.2.0.jar:/home/cloudera/myjars
Here's a sample run from /home/cloudera/myjars:
1. javac -cp kvclient.jar:hadoop-common-2.0.0-cdh4.2.0.jar:hadoop-mapreduce-client-core-2.0.0-cdh4.2.0.jar CountMinorKeys.java
This produces the following 3 classes:
-rwxrwxrwx. 1 cloudera cloudera 2008 May 5 14:51 CountMinorKeys.class
-rwxrwxrwx. 1 cloudera cloudera 1827 May 5 14:51 CountMinorKeys$Map.class
-rwxrwxrwx. 1 cloudera cloudera 425 May 5 14:51 CountMinorKeys$Reduce.class
2. jar cvf Count.jar Manifest.txt *.class
output:
added manifest
adding: Manifest.txt(in = 34) (out= 36)(deflated -5%)
adding: CountMinorKeys.class(in = 2008) (out= 1047)(deflated 47%)
adding: CountMinorKeys$Map.class(in = 1827) (out= 755)(deflated 58%)
adding: CountMinorKeys$Reduce.class(in = 425) (out= 266)(deflated 37%)
3. hadoop jar Count.jar hadoop.CountMinorKeys –libjars kvclient.jar kvstore localhost.localdomain:5000 /myCountOut
Output: (error as noted above)
Exception in thread "main" java.lang.NoClassDefFoundError: hadoop/CountMinorKeys$Map
at hadoop.CountMinorKeys.run(CountMinorKeys.java:103)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)