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@100.10.91.69 (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(Class.java:2615)
at java.lang.Class.getMethod0(Class.java:2856)
at java.lang.Class.getMethod(Class.java:1668)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration
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:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more

 

THOUGHTS? 

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

 

Cheers,

-MV

Outcomes