WebStart Problems with latest build.

Hi there. Managed to get my code up and running on my mac fine, but moving the whole thing over to webstart is giving me trouble. I get this error:

java.lang.ExceptionInInitializerError
	at javax.media.opengl.GLCanvas.<clinit>(GLCanvas.java:63)
	at SimpleGLEventListener.main(SimpleGLEventListener.java:547)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1108)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1055)
	at com.sun.javaws.Launcher.continueLaunch(Launcher.java:898)
	at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:469)
	at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:217)
	at com.sun.javaws.Launcher.run(Launcher.java:164)
	at java.lang.Thread.run(Thread.java:613)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission jogl.verbose read)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
	at java.security.AccessController.checkPermission(AccessController.java:427)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
	at java.lang.System.getProperty(System.java:627)
	at com.sun.opengl.impl.Debug$2.run(Debug.java:73)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.opengl.impl.Debug.isPropertyDefined(Debug.java:71)
	at com.sun.opengl.impl.Debug.<clinit>(Debug.java:53)

Now, i cant seem for the life of me to figure out what this is. Here is my JNLP File:

<?xml version="1.0" encoding="utf-8"?> 
<!-- JNLP File for SwingSet2 Demo Application --> 
<jnlp 
  spec="1.0+" 
  codebase="http://aig.cs.man.ac.uk/people/ben/jaws/" 
  href="daito.jnlp"> 
  <information> 
    <title>DAITO Experiment Tool B</title> 
    <vendor>Ben Blundell, Advanced Interfaces Group</vendor> 

    <description>DAITO Experiment Tool B</description> 
    <description kind="short">Tool B in the DAITO Experiment</description>

    <offline-allowed/> 
  </information> 
  <security>
<all-permissions/>
</security>
  <resources> 
    <j2se version="1.4.2+"/> 
    <jar href="daito.jar"/>
    <!--<jar href="mail.jar"/>
    <jar href="activation.jar"/>
    <extension href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" name="jogl"/> -->
    <extension name="colt" href="colt.jnlp"/>
    <extension name="jogl" href="jogl.jnlp"/>
  </resources>
   
<!--   <resources os="Mac OS">
    <j2se version="1.4.2+"/>
    <nativelib href="jogl-natives-macosx.jar"/>
  </resources> -->
   
  <application-desc main-class="SimpleGLEventListener">
  <argument>1.5</argument>
  <argument>test.txt</argument>
  <argument>questionspeoplepets.txt</argument> 
    </application-desc>
</jnlp>

and here is the jogl jnpl file:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://aig.cs.man.ac.uk/people/ben/jaws/" href="jogl.jnlp">
   <information>
      <title>JOGL</title>
      <vendor>Sun Microsystems, Inc.</vendor>
      <offline-allowed/>
   </information>
   <offline-allowed/>
   <resources>
      <jar href="jogl.jar"/>
   </resources>
   
   <resources os="MacOS"> 
        <nativelib href="jogl-natives-macos.jar"/> 
    </resource>
   <component-desc/>
</jnlp>

Any thoughts? Im using the same JOGL libs and the like throughout. No luck it seems :frowning:

A thought occurs… the native libs needed to be extracted from the jar and placed in the library path. At the moment, using webstart they are in the daito.jar but should they be in the jogl.jar?

You have two references to different JNLP extensions named “jogl”. One needs to be deleted. Unless there’s a really good reason for you to copy the JOGL jar files locally I would recommend you just point to the jogl.jnlp extension on download.java.net. Otherwise, delete the reference to the download.java.net version and make sure that you’ve either preserved the Sun-signed certificates or re-signed the jogl.jar and jogl-natives-*.jar files with your own certificate.

No dice im afraid. Something is badly wrong because it runs totally fine locally and webstart isnt exactly the most difficult or different of methods. Is thissomething to do with unpacking the macos native package? Does GLEvent Listener live inside these jnilibs? They were packaged inside a jar so it should be ok right?

java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at com.sun.jnlp.JNLPClassLoader.defineClass(JNLPClassLoader.java:314)
	at com.sun.jnlp.JNLPClassLoader.access$100(JNLPClassLoader.java:53)
	at com.sun.jnlp.JNLPClassLoader$1.run(JNLPClassLoader.java:254)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:247)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at com.sun.jnlp.JNLPClassLoader.loadClass(JNLPClassLoader.java:600)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at com.sun.javaws.Launcher.continueLaunch(Launcher.java:831)
	at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:469)
	at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:217)
	at com.sun.javaws.Launcher.run(Launcher.java:164)
	at java.lang.Thread.run(Thread.java:613)
<?xml version="1.0" encoding="utf-8"?> 
<!-- JNLP File for SwingSet2 Demo Application --> 
<jnlp 
  spec="1.0+" 
  codebase="http://aig.cs.man.ac.uk/people/ben/jaws/" 
  href="daito.jnlp"> 
  <information> 
    <title>DAITO Experiment Tool B</title> 
    <vendor>Ben Blundell, Advanced Interfaces Group</vendor> 

    <description>DAITO Experiment Tool B</description> 
    <description kind="short">Tool B in the DAITO Experiment</description>

    <offline-allowed/> 
  </information> 
  <security>
<all-permissions/>
</security>
  <resources> 
    <j2se version="1.4.2+"/> 
    <jar href="daito.jar"/>
    <!--<jar href="mail.jar"/>
    <jar href="activation.jar"/> -->
    <extension href="https://jogl.dev.java.net/webstart/jogl.jnlp" name="jogl" />
    <extension name="colt" href="colt.jnlp"/>
  </resources>   
  <application-desc main-class="SimpleGLEventListener">
  <argument>1.5</argument>
  <argument>test.txt</argument>
  <argument>questionspeoplepets.txt</argument> 
    </application-desc>
</jnlp>

Ok, now Im guessing that the link to the jnlp isnt the right one so i figured… lets use the one that comes with the latest GLGears Demo since we all know that works. Heres the JNLP:

 <resources> 
    <j2se version="1.4.2+"/> 
    <jar href="daito.jar"/>
    <!--<jar href="mail.jar"/>
    <jar href="activation.jar"/> -->
    <extension href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" name="jogl" />
    <extension name="colt" href="colt.jnlp"/>
  </resources>   
  <application-desc main-class="SimpleGLEventListener">
  <argument>1.5</argument>
  <argument>test.txt</argument>
  <argument>questionspeoplepets.txt</argument> 
    </application-desc>

And heres the error:

java.lang.NoSuchMethodError: javax.media.opengl.GLCanvas: method <init>()V not found
	at SimpleGLEventListener.main(SimpleGLEventListener.java:547)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1108)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1055)
	at com.sun.javaws.Launcher.continueLaunch(Launcher.java:898)
	at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:469)
	at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:217)
	at com.sun.javaws.Launcher.run(Launcher.java:164)
	at java.lang.Thread.run(Thread.java:613)

So it seems that no versions i “download” are correct… maybe i shouldnt be getting the natives for jogl… since i have the dylibs… hmmmm. Has anyone else managed to get the last nightly build to work as a webstart app? Sucks since it works locally so well :slight_smile:

Finally, sorry to spam so, if i upload the nightly build jars and sign them with my own signature just like the main program, I get this error:

java.lang.ExceptionInInitializerError
	at javax.media.opengl.GLCanvas.<clinit>(GLCanvas.java:63)
	at SimpleGLEventListener.main(SimpleGLEventListener.java:547)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1108)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1055)
	at com.sun.javaws.Launcher.continueLaunch(Launcher.java:898)
	at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:469)
	at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:217)
	at com.sun.javaws.Launcher.run(Launcher.java:164)
	at java.lang.Thread.run(Thread.java:613)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission jogl.verbose read)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
	at java.security.AccessController.checkPermission(AccessController.java:427)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
	at java.lang.System.getProperty(System.java:627)
	at com.sun.opengl.impl.Debug$2.run(Debug.java:73)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.opengl.impl.Debug.isPropertyDefined(Debug.java:71)
	at com.sun.opengl.impl.Debug.<clinit>(Debug.java:53)
	... 13 more

Errors errors everywhere but not a gear to see :slight_smile:

Slow down a bit. The first thing you should do is delete all local copies of JOGL from your system. You definitely should not have the jnilibs installed in your Extensions, since that will interfere with Java Web Start. You should instead put these in a separate directory and point to them with the environment variable DYLD_LIBRARY_PATH. You should also delete any local copies of jogl.jar from your Extensions directory and instead point to it with the environment variable CLASSPATH. You should then verify that the Gears demo works when launched with Java Web Start.

The public APIs have changed between the JSR-231 beta 1 and the current JOGL nightly build. If you want to build your application against the JOGL nightly build, you’ll need to copy the jogl.jar, jogl-natives-*.jars, and jogl.jnlp locally, sign all of those jars yourself, and modify the extension JNLP’s codebase.

Aye, cheers for the help. Im sure you know how it is when you get mad trying to get things to work. Ok, first question… what do you mean by the extensions folder? I guess just the working directory right? Finally, if the jnilibs are in another directory, how does that affect Java Webstart? I mean, presumably I can set classpaths and all that inside the JNLP but how can the jnilbs be loaded by webstart? Dont they have to be thrown inside a JAR? Cheers

Many people have been dropping the jogl.jar and jogl.dll/libjogl.so/libjogl.jnilib into their JREs, which interferes with Java Web Start and causes other mysterious problems. The “right way” to install JOGL for development purposes is documented in the JOGL Users’ Guide and involves un-jarring the jogl-natives-*.jar for your platform so that the system can find the shared libraries inside.

When deploying with Java Web Start, JWS automatically downloads and unjars the native library jar for you, so you don’t need to do so yourself or have a CLASSPATH or LD_LIBRARY_PATH set up. If you do, it will be ignored. The only situation in which JWS can’t ignore the existing jogl.jar or native libraries is if they were dropped in to the JRE, which is why you should never drop them there or in any other central location.

The steps you should follow to debug your deployment are as follows:

  1. Search your hard drive and delete all copies of jogl.jar and DLL/.so/.jnilib files associated with jogl (e.g., libjogl.jnilib). If you have installed a recent nightly build you should look for libjogl_awt.jnilib as well.

  2. Make sure the Gears demo works when launched via Java Web Start.

  3. Debug your deployment of your Java Web Start application.

  4. Re-install JOGL according to the instructions in the JOGL Users’ Guide.

  5. Re-check your deployment to make sure it is still working.

You should at that point be assured your deployment will work on other machines and know how to provide an FAQ on your web site to users having problems with it to delete any copies of JOGL in their JREs.