I am trying to run apache jmeter on my VM but getting this error.
D:\Users\1255592\Desktop\apache-jmeter-3.1\apache-jmeter-3.1\bin>jmeter
java.lang.NoClassDefFoundError: com/thoughtworks/xstream/converters/ConversionException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:257)
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.converters.ConversionException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more
JMeter home directory was detected as:
D:\Users\1255592\Desktop\apache-jmeter-3.1\apache-jmeter-3.1
I am using java 1.7
Your installation of JMeter is corrupt as the message here tells you that a class of xstream which is embedded as part of jmeter in lib folder is missing.
com.thoughtworks.xstream.converters.ConversionException
So reinstall your version and ensure you unzip in a folder that you own.
Related
Project runs fine in Eclipse running as an application. When trying to run the jar that is built by Maven I get the following error:
C:\test>java -jar SybaseTest.jar
C:\test>java -jar SybaseTest.jar
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
The jar file contains all of the libraries in the lib directory:
Libraries in the jar file
The manifest file has the library spring-context-4.3.2.RELEASE.jar in the classpath and the other 11 that are Maven dependencies.
Class-Path: . lib/spring-jdbc-4.3.2.RELEASE.jar lib/spring-beans-4.3.2
.RELEASE.jar lib/spring-core-4.3.2.RELEASE.jar lib/spring-tx-4.3.2.RE
LEASE.jar lib/spring-context-4.3.2.RELEASE.jar lib/spring-aop-4.3.2.R
ELEASE.jar lib/spring-expression-4.3.2.RELEASE.jar lib/commons-dbcp-1
.4.jar lib/commons-pool-1.6.jar lib/jconn4-7.0.jar lib/bcprov-jdk15on
-1.56.jar lib/commons-logging-1.2.jar
Any advice?
I am using this command to run my jar file
java -cp otpreq.jar com.otp.req.SendRequest
and its giving error-:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.methods.RequestEntity
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
Why this error is coming I can't figure out .
I checked the Library and org/apache/commons/httpclient/methods/RequestEntity is a Interface.
Assuming you have the http-client.jar:
java -cp otpreq.jar:http-client.jar com.otp.req.SendRequest
If O.S is windows, replace : by ;
Note: the newest httpclient is not located at apache commons, but at apache http components
You have to include all the supporting jars in class path (command line itself).
Or bind all your supporting jars inside otpreq.jar.
Either one of these will solve this issue.
Using Eclipse, I am modifying a Java project we have been using for years. a specific class method is typically executed by sending a message through IBM WebSphere MQ. However, I now have a need to develop some new functionality and I need to be able to test it out side the MQ world.
I am able to successfully debug the application in Eclipse, but if I attempt to execute the jar file from a command prompt I receive the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: XMLBuilder/Node
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: XMLBuilder.Node
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
My build is done using an ant script. This does not include a Class-Path attribute when creating the manifest.
The XMLBuilder.jar file is included in the target jar. Running jar -tf file.jar shows
META-INF/)
META-INF/MANIFEST.MF)
... Omitted for Brevity ...
XMLBuilder.jar
What might I be missing?
Thank you
I forked one project from github and when i want to run it gives error. I added org.json jar file to jdk\lib and also set the Path variable to it. I compiled code but it got no errors but when i run it i get exception as follows : (and I am running it using command prompt)
Error: A JNI error has occurred, please check your installation and
try again Exception in thread "main" java.lang.NoClassDefFoundError:
org/json/JSONExceptio n
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException:
org.json.JSONException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
Add required jar to classpath like this:
For *nix-like systems:
export CLASSPATH=<path-to-app>/myapp.jar:<path-to-app>/lib/json.jar:.
java MyApp
For Windows:
set CLASSPATH=<path-to-app>/myapp.jar;<path-to-app>/lib/json.jar;.
java MyApp
...or via manifest:
Manifest-Version: 1.0
Main-Class: MyApp
Class-Path: /lib/json.jar
I downloaded the opencsv (from http://sourceforge.net/projects/javacsv/files/latest/download) and since then I have been getting this error with all my Java programs
java.lang.NoClassDefFoundError: HelloWorld
Caused by: java.lang.ClassNotFoundException: HelloWorld
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"
How can I fix this? I realized I didn't need the opencsv anyway...how can I remove it so that my programs can compile and run as usual? I'm using Eclipse Version: 1.4.2.20120213-0813
You can remove a plugin by going to Help->About (or Eclipse->About on a Mac), choosing installations details, selecting the plugin you wish to remove, and choosing 'Uninstall'.