• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Could not find main class - JNLP

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having an error occur when I try to start my application from web start. It works fine with 'java -jar IMApp.jar'. I'm using netbeans 6.0, and it generated the JNLP file for me.
When I run it under WS, I get the message could not find main class in FastInfoset.jar. I don't understand why it is looking in that library jar file when main=true is set for IMApp.jar.
I'm really stumped! Here is the JNLP:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:/C:/projects/IMApp/dist/" href="launch.jnlp">
<title>Basic Application Example</title>
<vendor>Sun Microsystems Inc.</vendor>
<description>A simple java desktop application based on Swing Application Framework</description>
<description kind="short">Basic Application Example</description>
<homepage href="http://appframework.dev.java.net"/>;
<j2se version="1.5+" java-vm-args="-Djava.endorsed.dirs="C:\NetBeans6.0.1\java1\modules\ext\jaxws21\api" "/>
<jar href="IMApp.jar" main="true" download="eager"/>
<jar href="lib/FastInfoset.jar" download="eager"/>
<jar href="lib/activation.jar" download="eager"/>
<jar href="lib/appframework-1.0.3.jar" download="eager"/>
<jar href="lib/http.jar" download="eager"/>
<jar href="lib/jaxb-api.jar" download="eager"/>
<jar href="lib/jaxb-impl.jar" download="eager"/>
<jar href="lib/jaxb-xjc.jar" download="eager"/>
<jar href="lib/jaxws-api.jar" download="eager"/>
<jar href="lib/jaxws-rt.jar" download="eager"/>
<jar href="lib/jaxws-tools.jar" download="eager"/>
<jar href="lib/jsr173_api.jar" download="eager"/>
<jar href="lib/jsr181-api.jar" download="eager"/>
<jar href="lib/jsr250-api.jar" download="eager"/>
<jar href="lib/saaj-api.jar" download="eager"/>
<jar href="lib/saaj-impl.jar" download="eager"/>
<jar href="lib/sjsxp.jar" download="eager"/>
<jar href="lib/stax-ex.jar" download="eager"/>
<jar href="lib/streambuffer.jar" download="eager"/>
<jar href="lib/swing-worker-1.1.jar" download="eager"/>
<application-desc main-class="com.lovehorsepower.imapp.IMApp">

Any ideas? I'm really at a loss here.

Joseph Obernberger
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems like it might be a bug in Netbeans.
If I remove the
line, then it loads successfully!

Now I just need to figure out how to get netbeans 6.0.1, not to put that line in. The weird thing is that when I go to project properties, and pick 'Run', and remove the vm args, it just puts them back in.
I wonder if it's a problem with the goofy windows \ character.

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

I have a TrainingDNA.jnlp for TrainingDNA.jar. The jar and jnlp both are host from Tomcat Apache 6(webapps/root) on linux server. The jnlp launches jar file application fine in 64bit Windows OS but when I try from:
1. IE browser 32bit OS, Win XP it gives me error : "Could not find main class : " (Attached JVM Launcher error.jpeg), I had enabled java console to see output, below is the java console error:

Java Web Start 1.6.0_43
Using JRE version 1.6.0_43-b01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\s-projectusertwod
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
java.class.path=C:\\Program Files\\Java\\jre6\\lib\\deploy.jar
Java Path=null
MAX MEMORY=259522560
Executing: javaw.exe -Xmx1024M -classpath C:\\Program Files\\Java\\jre6\\lib\\deploy.jar com.sangha.gui.Main -propsResource /com/sangha/gui/client.cfg DNA.Client
java.lang.NoClassDefFoundError: com/sangha/gui/Main
Caused by: java.lang.ClassNotFoundException: com.sangha.gui.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

2. From Firefox just java Java 6 window comes and java console flashes for a second.

PS: There is nothing wrong with the TrainingDNA.jar since it runs fine on 32bit if I don't use JNLP and double click and run it.

[Thumbnail for JVM-Launcher-error.jpg]
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic