I was trying to Debug my application by running it from Eclipse after passing the arguments in the Debug configuration > Arguments . But im getting the error as below
java.lang.NoClassDefFoundError: C:\bea\jrockit_160_05\jre\bin\java
Caused by: java.lang.ClassNotFoundException: C:\bea\jrockit_160_05\jre\bin\java
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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
"C:\bea\jrockit_160_05\jre\bin\java" -Xms256m -Xmx256m -XX:PermSize=64M -XX:MaxPermSize=1000M ---------etc
etc are the arguments im passed .
Please help me to resolve this
Related
$ /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.
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
I'm trying to use hibernate 3.5.1 final in a swing application
and here are the jars I'm using:
hibernate-core-3.5.1-Final
hibernate-entitymanager-3.5.1-Final
hibernate-jpa-2.0-api-1.0.0.Final
hibernate-annotations-3.5.1-Final
hibernate-commons-annotations-3.2.0.Final
dom4j-1.6.1
slf4j-api-1.6.4
slf4j-log4j12-1.6.4
When I try to run the application, I get the following error:
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:127)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at com.xeno.xecamp.desktopManagement.Main.main(Main.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 11 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:127)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at com.xeno.xecamp.desktopManagement.Main.main(Main.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
You also need to include the Log4J JAR file in the classpath.
Note that slf4j-log4j12-1.6.4.jar is only an adapter to make it possible to use Log4J via the SLF4J API. It does not contain the actual implementation of Log4J.
You need to download log4j and add in your classpath.
In my environment, I just added the two files to class path. And is work fine.
slf4j-jdk14-1.7.25.jar
slf4j-api-1.7.25.jar
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
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.