Deploying the App with WebStart problem

Hello there. This is probably any stupidity i'm doing, but i searched at loads of places here, and googleing but still nothing. I'm trying to create a simple jnlp file with the simples program, HelloWorld, a jmetest class. The program runs as it should inside eclipse, but once I try and create a jnlp with the jars, even following the step by step, i cant manage to do it.



I still get the error: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path



i did the "Resolving the Build Path Issues" part in the http://www.jmonkeyengine.com/wiki/doku.php/setting_up_eclipse_to_build_jme_2



but still no luck. Here's the jnlp I'm using. I'm putting the .jars as the javaws ask me to.



<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
     codebase="file:///home/dread/WebApp" >

 <information>
   <title>Title</title>
   <vendor>your name</vendor>
   <homepage href="file:///dread"/>
   <description>Description</description>
   <offline-allowed/>
 </information>
 <security>
     <all-permissions/>
 </security>
 <resources>
   <jar href = "maggie.jar"/>
   <jar href = "jme.jar"/>
   <jar href = "lwjgl.jar"/>

 </resources>
  <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="HelloWorld"/>

</jnlp>

Here's the error it gives.



javaws applet.jnlp
Jul 9, 2010 3:13:48 PM com.jme.app.BaseGame start
INFO: Application started.
Jul 9, 2010 3:13:48 PM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
Jul 9, 2010 3:13:48 PM com.jme.system.PropertiesGameSettings load
WARNING: Could not load properties. Creating a new one.
Jul 9, 2010 3:13:48 PM com.jme.app.AbstractGame getAttributes
SEVERE:

Native library not set - go to
http://www.jmonkeyengine.com/wiki/doku.php?id=no_lwjgl_in_java.library.path
for details.
java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at org.lwjgl.Sys$1.run(Sys.java:72)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
at org.lwjgl.Sys.loadLibrary(Sys.java:81)
at org.lwjgl.Sys.<clinit>(Sys.java:98)
at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
at com.jme.system.lwjgl.LWJGLPropertiesDialog$ModesRetriever.run(LWJGLPropertiesDialog.java:682)
at com.jme.app.AbstractGame.getAttributes(AbstractGame.java:251)
at com.jme.app.BaseGame.start(BaseGame.java:67)
at HelloWorld.main(HelloWorld.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:454)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:731)

This is precisely the same problem I'm having currently. I even went as far as to make really sure I'm not doing anything wrong and externalized the entire lwjgl to how it really SHOULD work by doing this in my jnlp:



<extension name="lwjgl" href="http://lwjgl.org/jnlp/extension.php" />



by all means, this should work, or not?



anyway, before doing this, I tried all the other steps as well, like putting the dlls into a jar (in the root dir), signing it and referencing it in the jnlp:



  <resources os="Win">

  <j2se version="1.5+"/>

    <nativelib href="windows-native.jar"/>

  </resources>



I even checked in the java console viewer and all right, he downloaded that jar. But I either get the error message from the poster above, or, if I use the option I described as second I get:



Exception in game loop

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

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.loadLibrary0(Unknown Source)



It seems as if something is wrong with the lwjgl.jar, but I double-checked it and reference it like this in the jnlp:



    <jar href="lwjgl.jar" />

    <jar href="lwjgl_util.jar" />



and it also gets downloaded. I am missing something obvious, I guess…



The demos from the jme website work, so it's not like my drivers are rotten or something.

<resources os="Win">

    <j2se version="1.5+"/>

    <nativelib href="windows-native.jar"/>

  </resources>



have you treid exhangig this line witha a similar for the actuall dll's?

It turns out that there needs to be one(1) dll per jar, otherwise the classloader seems unable to determine which one to take. I simply put all the dlls (also for Openal etc.) into the same jar. It works now for me. Thanks for the help.

@YourConscience, i don get it. So u made a jar for each dll? Now u have like, 15 .jars for the windows native lib?



I have all these dlls inside windows-native.jar



./lwjgl/native/windows/jinput-dx8.dll

./lwjgl/native/windows/jinput-raw_64.dll

./lwjgl/native/windows/jinput-dx8_64.dll

./lwjgl/native/windows/OpenAL32.dll

./lwjgl/native/windows/lwjgl.dll

./lwjgl/native/windows/lwjgl64.dll

./lwjgl/native/windows/OpenAL64.dll

./lwjgl/native/windows/jinput-raw.dll

./jogl/native/windows_amd64/gluegen-rt.dll

./jogl/native/windows_amd64/jogl.dll

./jogl/native/windows_amd64/jogl_cg.dll

./jogl/native/windows_amd64/jogl_awt.dll

./jogl/native/windows_i586/gluegen-rt.dll

./jogl/native/windows_i586/jogl.dll

./jogl/native/windows_i586/jogl_cg.dll

./jogl/native/windows_i586/jogl_awt.dll





Can u plz explain how o did it?

I'm sorry, I take back what I wrote. What I did, in the end, was this:



In my main jnlp I wrote two lines like this:


  <resources>
    <j2se version="1.5+"/>
    <!-- ... my own jars -->

    <extension name="jme" href="jme.jnlp" />
    <extension name="lwjgl" href="lwjgl.jnlp" />
  </resources>



in the lwjgl.jnlp I have this:


<!-- JNLP Extension File -->
<jnlp spec="1.0+" codebase="myURL" href="lwjgl.jnlp">

  <information>
    <title>LWJGL</title>
    <vendor>LWJGL</vendor>
    <homepage href="http://lwjgl.org/"/>
    <description>LWJGL webstart extension</description>
    <description kind="short">LWJGL webstart extension</description>
    <icon kind="splash" href="jars/lwjgl/logo.png" />
    <offline-allowed/>
  </information>

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

  <resources>
    <j2se version="1.4+"/>
    <jar href="jars/lwjgl/lwjgl.jar"/>
    <jar href="jars/lwjgl/lwjgl_util.jar"/>
    <jar href="jars/lwjgl/jinput.jar"/>
  </resources>

  <resources os="Windows">
    <j2se version="1.4+"/>
    <nativelib href="jars/lwjgl/native_windows.jar"/>
  </resources>

  <resources os="Linux">
    <j2se version="1.4+"/>
    <nativelib href="jars/lwjgl/native_linux.jar"/>
  </resources>  

  <resources os="Mac OS X">
    <j2se version="1.4+"/>
    <nativelib href="jars/lwjgl/native_macosx.jar"/>
  </resources>

  <resources os="SunOS" arch="x86">
    <j2se version="1.4+"/>
    <nativelib href="jars/lwjgl/native_solaris.jar"/>
  </resources> 
 
  <component-desc />
</jnlp>



And then I simply downloaded the jars from the vendor:


http://lwjgl.org/jnlp/lwjgl.jar
...
http://lwjgl.org/jnlp/native_windows.jar



and put them into jars/lwjgl in my war file. The jme.jnlp looks like the one from the demos from the jme website, except I changed the url to my own one to not be dependant on the availability of their webserver.

Ok, using your suggestion I managed to make it work. I created a jar for each OS and each Arch, this way I have a linux-native64.jar with all the .so for the 64 arch(all the files are in the root of the .jar) and one linux-native386, with all the .so i for the 386 and so on. It worked like a charm. Tyvm for the tip. The main problem, i guess is that once u look at the wiki, it tells u to do this:





jar cvf windows-native.jar *.dll

jar cvf linux-native.jar *.so

jar cvf macos-native.jar *.jnilib *.dylib



but these commands dont work, so i use this:





jar cvf linux-native.jar find . -name *.so



but the jar created puts the files in their folders, so the structure of the .jar file looks like the way i posted b4. But it works now, tyvm.