File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Error while launching jnlp file

Navaneetha krishnan
Greenhorn

Joined: Sep 21, 2004
Posts: 26
Friends,

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 com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown 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">
<information>
<title>Java Web Start demo!</title>
<vendor>abcTechnologies, Inc.</vendor>
<homepage href="http://www.abc.com"/>
<description>Test Java web start application!!</description>
<icon href="images/java-logo.jpg"/>
</information>

<security>
<all-permissions/>
</security>

<resources>

<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>

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


<application-desc main-class="com.abc.swt.examples.SWTLabel">
</application-desc>

</jnlp>


Please help.

Thanks & Regards,
Navanee
Navaneetha krishnan
Greenhorn

Joined: Sep 21, 2004
Posts: 26
Guys,

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:

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

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



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: http://aspose.com/file-tools
 
subject: Error while launching jnlp file