AnsweredAssumed Answered

PROBLEM: Ported DEV 330 labs into Eclipse; running JAR on Hadoop VM issuing errors :-| ...

Question asked by markvogt on Feb 27, 2017
Latest reply on Mar 17, 2017 by deborah

Greetings all, 

I'm running through all the DEV 330 labs using Eclipse (Neon v.2) instead of Netbeans...


I'm on Lesson 7, and built my JAR file, then uploaded it to the MAPR Hadoop "sandbox" VM we have running. 

I uploaded the lab-exercises-shopping-1.0.jar file to /home/mapr, the account I'm using. 

The lab guide is decidedly unclear at this point how (specifically) we're supposed to "run the JAR on the cluster", but my interpretation is the following: 
UPLOAD the lab-exercises-shopping-1.0.jar file to /home/mapr using WinSCP

(ie, copy the JAR from my dev laptop to the MAPR Hadoop Sandbox VM, to /home/mapr/lab-exercises-shopping-1.0.jar.)

CREATE an SSH session to mapr@ (the IP address of our sandbox VM). 

CD to home/mapr. 

CONFIRM the JAR file is there.

RUN the following command from the SSH command prompt: 

[mapr@maprdemo ~]$ java -cp 'hbase classpath':./lab-exercises-shopping-1.0.jar shopping.ShoppingCartApp init


SO FAR SO GOOD... but HERE is what I get for a response: 

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(
at java.lang.Class.getMethod0(
at java.lang.Class.getMethod(
at sun.launcher.LauncherHelper.getMainMethod(
at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 6 more



NOTE: the source code passed all of the JUnit tests before I built the JAR file.