Help with JOGL and Java Web Start!

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with JOGL and Java Web Start!

kinglui987
Hey there,

at the moment im developing a java application, that i would like to distribute over java web start.
I'm really frustrating with getting this to work. I already studied the really nice tutorial for integrating jogl with jws
here: https://jogamp.org/wiki/index.php/Using_JOGL_in_Java_Web_Start.

After that i managed it to get my app started, when i run it on my local machine using the command line tool javaws!

After that i created a .html file, that calls my .jnlp file over the browser. But this seems not to work! I do not know why.
Any suggestions, it seems, that jws cannot find something! The deployment process succeeds until the desktop app is downloaded. Till this moment everything works fine!

In my .jnlp file i included references to my native jogl files, because i use a framework that depends on and old version of jogl.
Because of that i cannot use the online extension from here:http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp

I hope anyone can help me with that!!

thanks in advance

Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

Wade Walker
Administrator
Have you looked at the official JWS docs from Oracle? For example, the page at http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/setup.html seems to address the kinds of questions you're asking. I haven't included this sort of info yet on our wiki, because it seemed outside the scope of JOGL and more just about JWS/HTML/web sever admin topics.

Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

kinglui987
Hey thanks for your reply,

i read all about this! More than just once. Its been now one week, that i cannot get this to run!

i dont think, that the browser or server is not set up correctly.
The mime type is set correctly, the .jnlp file is download, then jws starts,
then the files are loaded, jws asks for permission, i grant premission,
a desktop shortcut gets created. Since this step everythings proceeds fine, locally and on the server!

Local: The application starts up and works like expected!

Remote:
After the desktop shortcut is created, the console shows, that a configuration file inside the root folder could
not be loaded. This configuration file is loaded using the getResourceAsStream() mechanism.
This file plays not a big role for my app to work properly, if the loading fails, default values are used, that should stick fine.

It seems that jws has no permission to read/write inside the root directory of my remote machine. Could this be the reason? As far as i know jws automatically unzips the native libs jar and uses the files matching the current OS.

Maybe you have an idea, what this might be??
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

gouessej
Administrator
Can you show us your JNLP file please?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

kinglui987
of course, here it is.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost/project/" href="j.jnlp">
    <information>
        <title>App-Name</title>
        <vendor>Vendor</vendor>
        <offline-allowed/>
	<homepage href="http://www.mypage.org" />
	<description>Descrition</description>
	 <shortcut online="false">
              <desktop/>
        </shortcut>

    </information>
<update check="background" policy="always"/>

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

    <resources>
        <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="256m" max-heap-size="512m"/>
	<jar href="app.jar" main="true" />
	<jar href="http://localhost/project/libs/gluegen-rt.jar"/>
	<jar href="http://localhost/project/libs/jogl.jar"/>
    </resources>

    <resources os="Mac OS X">
        <nativelib href = "http://localhost/project/libs/gluegen-rt-natives-macosx-universal.jar" />
        <nativelib href = "http://localhost/project/libs/jogl-natives-macosx-universal.jar" />
    </resources>

    <application-desc
         name="App-Name"
         main-class="fullQualified.package.Name"
         width="1024"
         height="768">
     </application-desc>
     <update check="background"/>
</jnlp>


I hope everything is fine with it. I checked the urls servel times. The jar files are all signed using the same keystore.
I test this using xampp, at the moment it is satisfactory when it works on os x.
I'm sure it has something to do with the failure of loading the file, although it is not an important file.
At the moment this is the only difference i can recognize.

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

gouessej
Administrator
In my humble opinion, you could try to use directly the native libraries, not the JARs containing them.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

Tami
In reply to this post by kinglui987
How did this end up going?  Did you figure out the problem?  I'm having so much trouble with JOGL and webstart too!!!
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

Pixelapp
In case this helps someone, here's how I use my JNLP. I works well with Newt or JFrame:


<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="file:////Users/UserName/Dropbox/Documents"
      href="TexturedPolygon.jnlp">
  <information>
    <title>Wavelogy</title>
    <vendor>Pixelapp Co.</vendor>
    <homepage href="http://pixelapp.biz/"/>
    <description>Wavelogy the game.</description>
    <description kind="short">Racing game.</description>
  </information>
  <update check="background" policy="always"/>

      <resources>     
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="TexturedPolygon.jar" main="true"/>
      <extension name="jogl-all-awt" href="http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" />
    </resources>

  <application-desc main-class="pixelapp.texturedpolygon.TexturedPolygon">
   <argument>NotFirstUIActionOnProcess</argument> 
  </application-desc>
</jnlp>
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

kinglui987
In reply to this post by Tami
Hey,

yes i could figure it out. In my case a file was missing. Although it was not a necessary file, this solved the problem.
I would recommend you to check, that everything your app needs is in one single jar file. Of course the native libs must
not be in that file. If your are using some, your have to reference them within the <resources> tag.

Which error message did you get, when starting your app with jws??

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Help with JOGL and Java Web Start!

gouessej
Administrator
You're right, kinglui987.

However, pixelapp showed an example of use in the case you don't want to host JOGL and GlueGen on your own server.

I already explained several times how to use Java Web Start with JOGL and it is explained in the wiki:
http://jogamp.org/wiki/index.php/Using_JOGL_in_Java_Web_Start

In my own project, all this is automatic, I just run my Ant script, enter a password and my source code gets compiled, JARs are created, signed and put into a directory. The JNLP file are created too. Then I only have to copy all files in the "target" directory into the correct directory on my FTP server. Feel free to look at it (if you accept the terms of the GPL v2). Another developer already uses my script for his project as he is a bit lazy ;) He doesn't want to spend a lot of time in deploying his application with Java Web Start.

Tami, if you need some help, please tell us exactly what is wrong, be more accurate.
Julien Gouesse | Personal blog | Website