jgrd (2) [Avatar] Offline
#1
Hi,

I'm trying to run my first webstart ever, from the very first example in the book (GroovyEdit). Unfortunately, the main class griffon.swing.SwingApplication inf file "staging/GroovyEdit.jar" is not found. The file application.jnlp says main jar is GroovyEdit.jar, but class the class griffon.swing.SwingApplication is in griffon-rt-0.9.jar. Is this the problem?

JNLPException[category: Erreur dans le fichier de lancement : Exception: null : LaunchDesc:
<jnlp spec="1.0+" codebase="file:/C:/temp/Griffon/GroovyEdit/staging/" version="0.1" href="file:/C:/temp/Griffon/GroovyEdit/staging/application.jnlp">
<information>
<title>GroovyEdit</title>
<vendor>GroovyEdit</vendor>
<homepage href="null"/>
<description>GroovyEdit</description>
<description kind="short">GroovyEdit</description>
<description kind="one-line">GroovyEdit</description>
<description kind="tooltip">GroovyEdit</description>
<icon href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-icon-48x48.png" height="48" width="48" kind="default"/>
<icon href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon.png" height="123" width="381" kind="splash"/>
<icon href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-icon-16x16.png" height="16" width="16" kind="shortcut"/>
<icon href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-icon-32x32.png" height="32" width="32" kind="shortcut"/>
</information>
<security>
<all-permissions/>
</security>
<update check="timeout" policy="always"/>
<resources>
<property name="griffon.runmode" value="webstart"/>
<property name="jnlp.packEnabled" value="true"/>
<java version="1.5+"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-rt-0.9.jar" download="eager" main="false"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar" download="eager" main="true"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/groovy-all-1.7.3.jar" download="eager" main="false"/>
</resources>
<application-desc main-class="griffon.swing.SwingApplication"/>
</jnlp> ]
at com.sun.javaws.LaunchDownload.getMainClassName(LaunchDownload.java:1110)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:941)
at com.sun.javaws.Launcher.run(Launcher.java:121)
at java.lang.Thread.run(Unknown Source)

env: griffon-0.9, groovy-1.7.3, java 1.6.0_21, win XP
Hope this is enough information.
Thanks,
Regards,
jgrd
andres.almiray (116) [Avatar] Offline
#2
Re: cannot run webstart
Hi,

I've don't know exactly what to tell you other that I ran the book's code with the latest 0.9 release and it worked fine. Also created a sample app and ran it successfully in webstart mode. Did you by any chance tweaked the jnlp template before running?

For reference, here's the jnlp file for the GroovyEdit application form the book's code repository (as updated by run-webstart)

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE jnlp SYSTEM "http://java.sun.com/dtd/JNLP-1.5.dtd">
<jnlp >
version="0.1"
codebase="file:/Users/aalmiray/dev/griffoninaction/chap01/GroovyEdit/staging"
href="application.jnlp"
>
<information>
<title>GroovyEdit</title>
<vendor>GroovyEdit</vendor>
<!--<homepage href="http://app.example.com/"/>-->
<!--fallback description-->
<description>GroovyEdit</description>
<description kind="one-line">GroovyEdit</description>
<description kind="short">GroovyEdit</description>
<description kind="tooltip">GroovyEdit</description>
<!-- fallback icon -->
<icon href="griffon-icon-48x48.png" kind="default" width="48" height="48"/>
<!-- icon used for splash screen -->
<icon href="griffon.png" kind="splash" width="381" height="123"/>
<!-- icon used in menu -->
<icon href="griffon-icon-16x16.png" kind="shortcut" width="16" height="16"/>
<!-- icon used on desktop -->
<icon href="griffon-icon-32x32.png" kind="shortcut" width="32" height="32"/>
<!-- to create shortcuts, uncomment this <br /> <shortcut online="true"> <br /> <desktop/> <br /> <menu submenu="GroovyEdit"/> <br /> </shortcut> <br /> <offline-allowed/> <br /> -->
</information>
<security>
<all-permissions/>
<!--<j2ee-application-client-permissions/>-->
</security>
<resources>
<property name="griffon.runmode" value="webstart"/>
<property name="jnlp.packEnabled" value="true"/>
<j2se version="1.5+" />
<!-- auto-added jars follow, griffon-rt, app, and groovy -->
<jar href='griffon-rt-0.9.jar'/>
<jar href='groovy-all-1.7.3.jar'/>
<jar href='GroovyEdit.jar' main='true' />
<!-- Add all extra jars below here, or the app may break -->


</resources>
<resources os='Mac OS X' arch='x86_64'>
</resources>
<application-desc main-class="griffon.swing.SwingApplication">
<!-- params are ignored when referenced from web page for 6u10 -->
<!--<param name="key1" value="value1"/>-->
<!--<param name="key2" value="value2"/>-->

</application-desc>
</jnlp>
jgrd (2) [Avatar] Offline
#3
Re: cannot run webstart
Hi,

thanks for your answer. I cannot see differences with the files, yours and mine, except "<resources os='Windows' arch='x86'>"!
I checked in ethe last book in case the syntax was outdated, but nothing different in the first example and starting over, he message remains the same
#### Java Web Start Error:
#### Impossible de trouver la classe principale griffon.swing.SwingApplication dans file:/C:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar

or exception:
at com.sun.javaws.LaunchDownload.getMainClassName(LaunchDownload.java:1110)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:941)
at com.sun.javaws.Launcher.run(Launcher.java:121)
at java.lang.Thread.run(Unknown Source)


I get the dialog "Impossible de lancer l'application" (Impossible to launch application)
name: GroovyEdit
Editor: GroovyEdit
from: file:// <- should this be empty?

Same message if I try to run the application as an applet : cannot find griffon.swing.SwingApplet dans file:/D:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar.

Am I the only one?!
Best regards
jgrd
dragan.stankovic (1) [Avatar] Offline
#4
Re: cannot run webstart
Hi!

I also had this problem. Take a look at this segment:


<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-rt-0.9.jar" download="eager" >main="false"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar" download="eager" >main="true"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/groovy-all-1.7.3.jar" download="eager" main="false"/>

The problem is this attribute main (in bold) which denotes .jar to search for mainclass.

Change the above segment to:

<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-rt-0.9.jar" download="eager" main="true"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar" download="eager" main="false"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/groovy-all-1.7.3.jar" download="eager" main="false"/>

and it should work.
I am not sure why it works on Mac even with wrongly set main class but on WindowsXP environment and with griffon-rt-0.9.2-beta-1 it didn't.

I hope that this helps!
andres.almiray (116) [Avatar] Offline
#5
Re: cannot run webstart
Thank you for the diagnosis Dragan. I've filed http://jira.codehaus.org/browse/GRIFFON-272 to keep track of this problem. A fix should be ready for the next release.

Cheers,
Andres
jvandal (16) [Avatar] Offline
#6
Re: cannot run webstart
I get jarsigner error. on webstart and applet. Will this fix fix the problem?
rajshekar (34) [Avatar] Offline
#7
Re: cannot run webstart
Hiiii,

Am also having the same problem but as you said in which file do we need to change this segment

<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/griffon-rt-0.9.jar" download="eager" main="true"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/GroovyEdit.jar" download="eager" main="false"/>
<jar href="file:/C:/temp/Griffon/GroovyEdit/staging/groovy-all-1.7.3.jar" download="eager" main="false"/>

in which file do we need to change this???

Thanks,
Rajshekar