[SOLVED] jME webstart deployment

Hello!



I’m near to deploying my very first jme application and I want to use webstart technology. Said so, I’ve signed all my jar files and jme files except from lwjgl.jar, which comes already signed.

Problem is, when I launch jnlp, that after dowloading it says:



“Impossible to launch the application. JAR resources of the JNLP file were signed using different certificates” (or something like this, I’m not using EN locale)



What do I do? :?



Don’t know if this matters, here are the 2 jnlp files, as described in the wiki http://www.jmonkeyengine.com/wiki/doku.php?id=jme_webstart_step_by_step



spaceadv.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://www.xxx.yyy"
      href="spaceadv.jnlp">
 
  <information>
    <title>XXX</title>
    <vendor>xxx</vendor>
    <homepage href="www.xxx.yyy"/>
    <description>Space Adventure Game Demo</description>
    <description kind="short">Using JIVES Framework v0.7</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>
  <resources>
    <jar href="spaceadv.jar"/>
   <jar href="spaceadv-data.jar"/>
   <jar href="lwjgl.jar"/>
   <jar href="jives-0.7.jar"/>
    <jar href="jme.jar" />
    <jar href="jme-audio.jar" />
   <jar href="jme-awt.jar" />
   <jar href="jme-collada.jar" />
   <jar href="jme-editors.jar" />
   <jar href="jme-effects.jar" />
   <jar href="jme-font.jar" />
   <jar href="jme-gamestates.jar" />
   <jar href="jme-model.jar" />
    <jar href="jme-scene.jar" />
   <jar href="jme-terrain.jar" />
   <jar href="jme-xml.jar" />
   <jar href="xstream-1.1.1.jar" />
   <extension name="lwjgl" href="lwjgl.jnlp"/>
  </resources>
 
  <property key="java.library.path" value="." />
 
  <resources os="Windows">
     <j2se version="1.5+"/>
    <nativelib href="windows-native.jar"/>
  </resources>
  <resources os="Mac OS">
    <j2se version="1.5+"/>
    <nativelib href="macos-native.jar"/>
  </resources>
  <resources os="Linux" arch="i386">
    <j2se version="1.5+"/>
    <nativelib href="linux-native.jar"/>
  </resources>
  <application-desc main-class="main.SpaceAdventure"/>
  <component-desc/>
</jnlp>



lwjgl.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
      codebase="http://www.xxx.yyy"
      href="lwjgl.jnlp">
  <information>
    <title>lwjgl</title>
    <vendor>xxx</vendor>
  </information>
  <component-desc/>
  <security>
      <all-permissions/>
  </security>
  <resources>
    <jar href="lwjgl.jar"/>
  <resources/>
</jnlp>



I'd be glad if you can point me out on how to resolve this.
Thank you!

make sure, all the jars in spaceadv.jnlp are signed with the same signature.



btw. the current lwjgl,jar in the svn is not signed anymore i think, but it should still work with two seperate jnlp files.

Thanks for the answer Core-Dump.

I downloaded an unsigned copy of lwjgl.jar from lwjgl.org, signed it, put it all toghether, ran it with webstart.

It downloaded all jars succesfully, prompted me to trust the application and then…

[pre]

java.lang.NullPointerException

at com.jme.app.FixedFramerateGame.start(Unknown Source)

at main.SpaceAdventure.main(SpaceAdventure.java:30)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

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

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

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

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

at java.lang.Thread.run(Unknown Source)

[/pre]



I know webstart application doesn’t work because of an

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path



If I put lwjgl.dll in the same folder of the application, it works…

Is there a smarter way to distribute my application than to say “remember to add the native library in the application folder!” ? :’(

put all the native libraries into a jar and add the jar to the jnlp, its explained in the wiki entry :slight_smile:

I rebuilt and signed the native libraries with my signed version of lwjgl.jar

This time it worked.

Thanks a ton :smiley:





EDIT:

P.S.:Someone should change the wiki article, as it suggest NOT to sign lwjgl.jar "as it comes already signed"

its a wiki, everyone can edit it once registred :wink:



i changed the wiki entry

Core-Dump said:

its a wiki, everyone can edit it once registred ;)


Wow... power to the masses! Thanks for your help, my application is finally deployed, after some hours spent quarrelling with resource loaders and case sensitive file names :-o

I'm gonna show off soon in the showcase forum XD

Did you tried the pack200 tool (http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/pack200.html) for your deployment?

I didn't know about this tool before… sounds very interesting, it's able to reduce download size and it's supported by java web start, too. I'll give that a try, thanks for the suggestion!