Author Topic: Error with webstart  (Read 12193 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #15 on: December 20, 2006, 08:12:02 pm »
Here's how the current Paradroidz-jar is looking:

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://www.jpct.net/para3d2" href="test.jnlp">
<application-desc main-class="naroth.start.StartFrame"/>
<information>
<title>Paradroidz</title>
<vendor>jPCT - http://www.jpct.net</vendor>
<homepage href="http://www.jpct.net/paradroidz"/>
<description>Paradroidz -  a 3d remake of the C64 classic game</description>
<icon href="logo.jpg"/>
<icon kind="splash" href="splash.jpg"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
<jar href="Naroth.jar"/>
<jar href="lib/jpct.jar"/>
<jar href="lib/lwjgl.jar"/>
<jar href="lib/lwjgl_util.jar"/>
</resources>
<resources os="Windows">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_win.jar"/>
<property name="java.library.path" value="." />
</resources>
<resources os="Linux" arch="i386">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_linux.jar"/>
<property name="java.library.path" value="." />
</resources>
  <resources os="Mac OS X">
<j2se version="1.4+"/>
    <nativelib href="lib/lwjgl_osx.jar"/>
<property name="java.library.path" value="." />
  </resources>
</jnlp>



Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #16 on: December 20, 2006, 08:56:00 pm »
I did as you told.

But a strange thing happens.

In jdk1.5, it is fine, but in jdk1.4, still can't find the dll.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #17 on: December 20, 2006, 08:58:55 pm »
Try it without the

<property name="java.library.path" value="." />

thing for Java1.4. I remember that i had to add this for 1.5. Maybe it causes trouble with 1.4? I can't test it ATM, no Java 1.4 on this machine. But at work, i'm still using Java1.4 and my jnlp works fine there...well, you never know. Just give it a try.

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #18 on: December 20, 2006, 09:27:36 pm »
after remove that line, it is still not working in jdk1.4

I am crazy about this issue.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #19 on: December 20, 2006, 09:29:30 pm »
How's the jnlp looking now?

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #20 on: December 20, 2006, 09:31:32 pm »
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://......" href=".....jnlp">
<application-desc main-class="com.horse.HorseRunnerMain"/>
<information>
<title>...</title>
<vendor>...</vendor>
<homepage href="http://......"/>
<description>...</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
<jar href="horseracing.jar" main="true"/>
</resources>
<resources os="Windows">
<j2se version="1.4+"/>
<nativelib href="lib/lwjgl_win.jar"/>
</resources>
</jnlp>

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #21 on: December 20, 2006, 09:35:56 pm »
That's not what i suggested. Try to change this part:

Code: [Select]
<resources>
   <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
   <jar href="horseracing.jar" main="true"/>
</resources>
<resources os="Windows">
   <j2se version="1.4+"/>
   <nativelib href="lib/lwjgl_win.jar"/>
</resources>


to something like this:

Code: [Select]
<resources>
   <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
   <jar href="horseracing.jar" main="true"/>
   <jar href="lwjgl.jar"/>
</resources>
<resources os="Windows">
   <j2se version="1.4+"/>
   <nativelib href="lib/lwjgl_win.jar"/>
   <property name="java.library.path" value="." />
</resources>


Where lwjgl.jar is the plain and simple lwjgl.jar containing the java-parts of lwjgl and lwjgl_win.jar is a renamed .zip containing all the dlls needed.

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #22 on: December 20, 2006, 09:44:58 pm »
already tried. doesn't work in jdk1.4, even remove the property line

Code: [Select]
  <resources>
      <j2se version="1.4+" initial-heap-size="128m" max-heap-size="300m"/>
      <jar href="horseracing.jar" main="true"/>
      <jar href="lib/lwjgl.jar"/>
      <jar href="lib/lwjgl_util.jar"/>
   </resources>
   <resources os="Windows">
      <j2se version="1.4+"/>
      <nativelib href="lib/lwjgl_win.jar"/>
      <property name="java.library.path" value="." />
   </resources>

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #23 on: December 20, 2006, 09:48:36 pm »
Does Paradroidz work in your 1.4 installation? http://www.jpct.net/para3d2/test.jnlp

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #24 on: December 20, 2006, 09:53:45 pm »
Yes, it works.
what's the code of the transferring the dll to local machine?
following is my code:
Code: [Select]
String home="C:/ampm/player";
     try {
         String base=servletPath+"/client/player/";
         byte[] dll=new Transferer(base+"lwjgl.dll").transfer();
         File file=new File(home);
         file.mkdirs();
         file=new File(home+"/lwjgl.dll");
         OutputStream out=new FileOutputStream(file);
         out.write(dll,0,dll.length);
         out.close();
      } catch(Exception e) {
         e.printStackTrace();
      }

Should I use System.load or something else to load the dll?

The Paradroidz  will pass the dll to the client, right?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #25 on: December 20, 2006, 10:00:52 pm »
:?: There's no need to transfer the dll in your code when using webstart. Just put it in the native section of the jnlp and webstart will take care of it. Write your application as if there is no dll (i.e. it's just specified at startup via the library.path), don't try to copy the dll around manually.

Offline qjvictor

  • int
  • **
  • Posts: 77
    • View Profile
Error with webstart
« Reply #26 on: December 20, 2006, 10:02:31 pm »
ok, I will have a try.
tell you the result.

Could you give me a code slip which use java.library.path at the starting?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #27 on: December 20, 2006, 10:29:48 pm »
No code has be written for this. Just start your application with that parameter. For example, Paradroidz as an application starts like this:

Code: [Select]
java -Xmx256m -cp lib\jpct.jar;lib\lwjgl.jar;lib\lwjgl_util.jar;bin\Naroth.jar -Djava.library.path=lib naroth.start.StartFrame

All native parts (dlls for Windows, bins for Linux etc) are in that lib-directory. That's all. No code has to be written here. In webstart, just give the jar containing the native part for the underlying platform like the given jnlp already does and you are done.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Error with webstart
« Reply #28 on: December 21, 2006, 09:46:23 am »
And? Given up?  :wink: