File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JNLP and Web Start and the fly likes Error while launching jnlp file 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 "Error while launching jnlp file" Watch "Error while launching jnlp file" New topic

Error while launching jnlp file

Navaneetha krishnan

Joined: Sep 21, 2004
Posts: 26

I have a simple SWT application (helloworld appln). I tried to make use of Java Web start for that application. I wrote a .jnlp file and when i execute it, it throws the following error:

java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

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.executeApplication(Unknown Source)

at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

at com.sun.javaws.Launcher.continueLaunch(Unknown Source)

at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)

at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)

at Source)

at Source)

I have signed all the related jar files properly. Every time i try to run the Java web start application, it throws some error. I have searched many forums and I do not find an answer that solves my answer.

Here is my jnlp file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost/test/helloswt" href="helloswt.jnlp">
<title>Java Web Start demo!</title>
<vendor>abcTechnologies, Inc.</vendor>
<homepage href=""/>
<description>Test Java web start application!!</description>
<icon href="images/java-logo.jpg"/>



<j2se version="1.3+"/>

<jar href="test.jar"/>
<jar href="plugins/org.eclipse.core.commands_3.1.0.jar"/>
<jar href="plugins/org.eclipse.core.expressions_3.1.0.jar"/>
<jar href="plugins/org.eclipse.core.runtime_3.1.1.jar"/>
<jar href="plugins/org.eclipse.help_3.1.0.jar"/>
<jar href="plugins/org.eclipse.jface_3.1.1.jar"/>

<jar href="plugins/org.eclipse.osgi_3.1.1.jar"/>

<jar href="plugins/org.eclipse.swt_3.1.0.jar"/>

<jar href="plugins/org.eclipse.ui_3.1.1.jar"/>

<jar href="plugins/org.eclipse.ui.workbench_3.1.1.jar"/>


<resources os="Windows">
<nativelib href="plugins/org.eclipse.swt.win32.win32.x86_3.1.1.jar"/>

<application-desc main-class="">


Please help.

Thanks & Regards,
Navaneetha krishnan

Joined: Sep 21, 2004
Posts: 26

I tried a lot of combinations and I found out the solution myself!! Thought of sharing the same for someone who might hit at a similar error. I removed the unused jar file entries from the jnlp file and modified the jnlp like this:

<j2se version="1.3+"/>
<jar href="test.jar"/>
<jar href="plugins/org.eclipse.swt.win32.win32.x86_3.1.1.jar" />

<resources os="Windows">
<nativelib href="plugins/org.eclipse.swt.win32.win32.x86_3.1.1.jar"/>

This worked without any issue. I am still not sure how this worked. But it is working

Thanks for the support.
I agree. Here's the link:
subject: Error while launching jnlp file
It's not a secret anymore!