I am now trying to deploy a Java application with Java Web Start. The application works fine when running standalone. I exported the project as a runnable .jar file, and then wrote the corresponding jnlp file.
However, when running from the jnlp file, the application returns the following error when starting up:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: someClass
........
Caused by: java.lang.ClassNotFoundException: someClass
.........
I exported the .jar file using Eclipse Helios with the option "Package required libraries into generated JAR".
Here's what my jnlp file looks like (I substituted some information):
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
codebase="................"
href="thisJNLP.jnlp">
<information>
<title>Whatever</title>
<vendor>Whatever</vendor>
</information>
<security>
<all-permissions/>
</security>
<resources>
<!-- Application Resources -->
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="signed.jar" main="true" />
</resources>
<application-desc
name="Whatever"
main-class="thisProject.main"
width="300"
height="300">
</application-desc>
<update check="background"/>
</jnlp>
In addition, I am using WebLogic 10 to host the files, but I doubt that will make any difference.
Could someone help me out?
Thanks for any inputs!
From the WebStart Developer's Guide:
So the class loader mechanism is different for WebStart applications. I assume it's the packaging option "Package required libraries into generated JAR" that causes problems in your case.
Is the class
someClass
contained in a jar that is contained within yoursigned.jar
file? If so, this would back this theory - try generating separate jar files (don't forget to sign them all!) and reference each of them in the<resources>
section as a separate<jar>
entry.