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

$ /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.

Related

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

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

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

NoClassDefFoundError error on Mac with NetBeans

I am getting a NoClassDefFoundError error when I run my program. Here is the stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: ex7/Ex7
Caused by: java.lang.ClassNotFoundException: ex7.Ex7
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Java Result: 1
How do I fix this? I'm on a Mac and running NetBeans.
It seems class Ex7class from package ex7 isn't in classpath. recheck the class try clean build

java.lang.NoClassDefFoundError

i am geting following error
Am i missing some jar file?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
at org.smslib.helper.Logger.<init>(Logger.java:34)
at org.smslib.Service.<init>(Service.java:93)
at SendMessage.doIt(SendMessage.java:28)
at SendMessage.main(SendMessage.java:82)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
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 sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 6 more
Java Result: 1
Yes, you need the Apache Logging JAR file on your classpath. Download it here: http://commons.apache.org/downloads/download_logging.cgi
Adding the jar files to ant lib will make them available for ant's java process and not your applications java process. Setting your application's classpath correctly must work.

Categories

Resources