Is there proper guideline on how to deploy Swing application with JWS?
Here is what I have been trying
Created Swing application with Netbeans. And trying to deploy ready application with Java web start.
Project Property -> Application -> Web start, Enabled Web start, fixed all necessary fields.
By using Tomcat or WAMP server, I was able to run jnlp file, it downloads necessary libraries and right after launch I get following error:
java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
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 com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
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 com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
But json.simple jar file is in classpath and application is running normal locally (without JWS).
Why despite having library in classpath, I get NoClassDefFoundError error?
jnlp file seem to have it listed <jar href="lib/json-simple-1.1.1.jar"/>.
Surfed around net but couldn't find a fix for the issue. Anyone had similar issues, please help! And Please ask for clarification before marking this question as duplicate, thanks!
Related
I have java project I convert it to .jar file using netbeans Clean & Build, I used cmd to run the .jar file it successfully run without errors, then I want to convert it to .exe file using launch4j but the problem is I have this error:
Executing: C:\Users\LaLa\Desktop\el.exe
Exception in thread "main" java.lang.NoClassDefFoundError: com/toedter/calendar/JDateChooser
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: com.toedter.calendar.JDateChooser
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
What could be the possible error I made? or I shouldn't made to avoid it?
(I'm totally new to java programming, I'd ask you please to write solution in details)
I saved my .exe file in dist folder that contains my .jar file & lib folder.
It worked as I wanted. Thanks to All!
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.
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
Background: I am a C# developer, but my next project needs to be on the JVM. I have researched Scala and I think that it lets me to what I can in C# (Lambdas, inferred types, functional-style, etc). I would classify myself as a very novice Java developer... especially when it comes to using the IDE's, etc.
I have a Scala project that seems to work...
I made a Java project and referenced the Scala project
The editor seems to know about the classes in the Scala project (typeahead, etc)
When I try to run the Java project, I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: scala/ScalaObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(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)
at learning_scala.java.Main.main(Main.java:12)
Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
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)
Clearly something has gone awry in the Java/Scala compilation, but I have no idea how to resolve it (my lack of Java experience being the primary culprit here)
I'm using Eclipse w/ the official Scala plugin... all of which are up to date as of 2-3 days ago.
Thanks
You need to add the scala-library.jar library to your classpath. You can do that a few different ways but the simplest is to copy the file into your project (drag and drop it into your eclipse package explorer). Next, right click on the file and select add to build path. That adds the scala jar to your classpath. That should fix the problem.