• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Error while launching jnlp file

Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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



<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="com.abc.swt.examples.SWTLabel">


Please help.

Thanks & Regards,
Navaneetha krishnan
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!