aspose file tools*
The moose likes JNLP and Web Start and the fly likes Jnlp cannot find the main class in a Jar packaged using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Jnlp cannot find the main class in a Jar packaged using "OneJar"." Watch "Jnlp cannot find the main class in a Jar packaged using "OneJar"." New topic
Author

Jnlp cannot find the main class in a Jar packaged using "OneJar".

Vishnu Shankar Pandey
Greenhorn

Joined: Oct 27, 2011
Posts: 1
Howdy Felows,

I have a Jnlp trying to load an applet from a jar("a.jar") which has in turn been packaged into a bigger "project.jar".
To package the project resources into "project.jar",i have used the open source tool "OneJar".
The main class 'applet_name' is present in "a.jar".

The Manifest of ant build task to package the project jars using "One-Jar " is:

<manifest>
<attribute name="Main-Class" value="com.simontuffs.onejar.Boot "/>
<attribute name="One-Jar-Main-Class" value="abcd.efgh.xyz.applet.applet_name"/>
</manifest>
<main>
<fileset file="${src.dir}/a.jar"/>
<fileset file="${src.dir}/otherjars.jar"/>
</main>


I have packaged the "a.jar"(containing the applet class) into the main.jar as well as the lib by specifying it in the ant task.

The Code to access it via JNLP is:
<resources>
<!-- Application Resources -->
<jar href='project.jar' main='true' />

</resources>
<applet-desc
name='Applet_name'
main-class='abcd.efgh.xyz.applet.applet_name' width='1350' height='700'>

The error being thrown here is that the Jnlp cannot find my main class:

java.lang.ClassNotFoundException: abcd.efgh.xyz.applet.applet_name
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)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)

Any suggestions as to how the jnlp can find the main class(applet_name)..??

Thanks for reading all this..

Regards
Tushar Pandey


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jnlp cannot find the main class in a Jar packaged using "OneJar".