Exception in thread "main" java.lang.ClassNotFoundException: orienit.hadoop.training.sed - java

Exception in thread "main" java.lang.ClassNotFoundException: orienit.hadoop.training.sed
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
running this in ubuntu......
in terminal my cmd is :hadoop jar /home/hadoop/work/testhadoop.jar orienit.hadoop.training.sed /words /sed

command should be like this:
hadoop jar /home/hadoop/work/testhadoop.jar orienit.hadoop.training.sed.SedJob /words /sed
your are missing the ClassName after the package

Related

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli2/Option

Mr-Protocol:bin blossommendes$ `hadoop jar /Users/blossommendes/Desktop/Project/mahout-mrlegacy-1.0-SNAPSHOT.jar org.apache.mahout.cf.taste.hadoop.similarity.item.ItemSimilarityJob -Dmapred.input.dir=/xd/hdfsImport -Dmapred.output.dir=/xd/hdfsImport/postsResults --s SIMILARITY_LOGLIKELIHOOD --booleanData`
after executing above command i am getting following exception .. i dont why .. please help me to solve this issue
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli2/Option
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli2.Option
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
You are missing the org.apache.commons.cli2 Jar in your Classpath.

Java3D setup - MacOSx

When trying to run a basic HelloUniverse program, i get the following error.
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesChooser
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at javax.media.j3d.Pipeline$1.run(Pipeline.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:157)
at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:965)
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:299)
at HelloUniverse.init(HelloUniverse.java:55)
at com.sun.j3d.utils.applet.MainFrame.run(MainFrame.java:267)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException:
javax.media.opengl.GLCapabilitiesChooser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
I can't seem to find a solution to get Java3D working on mac.

java.lang.NoClassDefFoundError org.apache.hadoop.hbase.mapreduce.ImportTsv

$ /usr/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/mapreduce/ImportTsv
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.mapreduce.ImportTsv
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.apache.hadoop.hbase.mapreduce.ImportTsv. Program will exit.
Try running /usr/bin/hbase classpath and see if hbase.jar is on your classpath.
If it is not or the paths are wrong check your hbase configuration
/etc/hbase/conf/hbase-env.sh and make sure you do not have an environment $HBASE_HOME set to the incorrect location.

HADOOP_CLASSPATH issue while running jar

I have created an map-red job which uses the apache-commons-cli library shipped with the hadoop under $HADOOP_HOME/lib/.
Now, if I create a jar and then try to run my job using
./hadoop -jar myjob.jar
I get the below exception:
Warning: $HADOOP_HOME is deprecated.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
at java.lang.Class.getMethod0(Class.java:2764)
at java.lang.Class.getMethod(Class.java:1653)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.CommandLineParser
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:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357
I can see that common-cli-xxx.jar is present in my $HADOOP_HOME/lib dir. I don't know what wrong I am doing here.
Type just hadoop in your terminal if it does not show list of all the hadoop command,
you can check whether
export PATH=$PATH:$HADOOP_HOME/bin
export HADOOP_HOME=/usr/local/hadoop
lines are added to your .bashrc

MySQL Connector Classpath

my $CLASSPATH skills are not too great and I am having trouble setting up mysql-connector to use my MySQLAccess class. I compiled and put MySQLAccess class inside the same directory as my-sql-connector.jar Here is my code:
java -classpath :/home/rick/Downloads/mysql-connector-java-5.1.22/mysql-connector-java-5.1.22-bin.jar MySQLAccess
Exception in thread "main" java.lang.NoClassDefFoundError: MySQLAccess
Caused by: java.lang.ClassNotFoundException: MySQLAccess
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: MySQLAccess. Program will exit.
put a . that indicate current location also
java -classpath /home/rick/Downloads/mysql-connector-java-5.1.22/mysql-connector-java-5.1.22-bin.jar:. MySQLAccess

Categories

Resources