Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

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

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

Wade Walker
Administrator
OK, I'll try my luck wrapping my JNLP into an applet. I've never done an applet before, so it might take me a bit of experimentation... thankfully I have a four-day weekend starting tomorrow
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

Wade Walker
Administrator
In reply to this post by blainebell
I got a simple JOGL applet to work on Mac OS X 10.6.7, Java 1.6.0_24 using the JNLPAppletLoader. I zipped up my HTML and JNLP files at jws-mac.zip. Just download the file and follow the instructions in the README.txt, and it should work for you.

This is a super-simple program that just draws one triangle, but it should work as a proof of concept

I didn't do anything strange -- I left the Java preferences at the default, to run applets within the browser process. I ran the whole thing without a web server to take that variable out of the equation as well. That means you'll have to edit the paths inside the HTML and JNLP files to match where you unzip the directory on your machine.

This zip archive contains a debug version of the JNLPAppletLoader that I compiled, so if you use it you'll see more debug info in the Java console that may be helpful to you.

In the course of doing this, I noticed that it doesn't work in Firefox or Chrome, and neither does the JOGL applet test page at http://jogamp.org/jogl-demos/www/applettest-jnlp.html. Here's the breakdown:

Safari 5.0.4: works with JNLPAppletLoader
Firefox 4.0: loads the applet, but drawing area is blank white (using JNLP2ClassLoader)
Chrome 10.0.648.205: loads the applet, but drawing area is blank white (using JNLP2ClassLoader)

I've filed a bug report for these last two at https://jogamp.org/bugzilla/show_bug.cgi?id=497 so you can CC yourself to follow progress.
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

blainebell
sorry its taken me a while to get back to this thread.  Wade, thanks a lot for doing this.

I get the same exact behavior with your example that I do with my applet.  Inside safari when applets run in their own process, it runs, but I do not see the Triangle inside the browser.  I need to apple-click on it, then drag the window outside of the browser to see it.  If I set the applets to run within the browser process, I get:

VALIDATE: libnewt.jnilib
java.io.IOException: Cannot validate certificate for libnewt.jnilib
        at org.jdesktop.applet.util.JNLPAppletLauncher.validateCertificates(JNLPAppletLauncher.java:1870)

Here is the full log from the debugged version of JNLPAppletLoader:

error.log

I have also tried to move this directory to under a local webserver, but I get the same behavior.

I still don't know what this message means, and why it wouldn't be able to validate a certificate for a jnilib, since the jarsigner should correctly sign the jar files and all of the files inside it.  If anyone has any idea, let me know.

Thanks!

Blaine
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

blainebell
Oh, I have just noticed that I am using Safari 5.0.5, and I'm not sure how to go back to 5.0.4 to see if i get the same behavior as you.  Maybe you can try 5.0.5?  Also, I am using Firefox 3.6.16 since I had problems with Firefox 4

The blank white area that you are reporting: are you able to apple-click on it and separate the applet from the browser?  Can you see the rendering once you separate it?  That's the behavior I am seeing when the applet is running in a separate process.

Blaine
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

Wade Walker
Administrator
In reply to this post by blainebell
blainebell wrote
VALIDATE: libnewt.jnilib
java.io.IOException: Cannot validate certificate for libnewt.jnilib
        at org.jdesktop.applet.util.JNLPAppletLauncher.validateCertificates(JNLPAppletLauncher.java:1870)
...
I still don't know what this message means, and why it wouldn't be able to validate a certificate for a jnilib, since the jarsigner should correctly sign the jar files and all of the files inside it.  If anyone has any idea, let me know.
Looking at the code for JNLPAppletLauncher, it looks like this error happens if libnewt.jnilib either doesn't contain a security certificate at all, or if its certificates don't all match the ones in the JAR file that contains JNLPAppletLauncher. So perhaps you're pulling your JARs and natives from two different places? Your log says it's using a previously cached version of the natives JAR, so you might try deleting the cache in /Users/bell/.jnlp-applet. You could also try putting a few print statements in JNLPAppletLauncher.checkNativeCertificates() to find exactly where it's failing.
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

Wade Walker
Administrator
In reply to this post by blainebell
blainebell wrote
Oh, I have just noticed that I am using Safari 5.0.5, and I'm not sure how to go back to 5.0.4 to see if i get the same behavior as you.  Maybe you can try 5.0.5?
I upgraded to Safari 5.0.5, and it still works

blainebell wrote
The blank white area that you are reporting: are you able to apple-click on it and separate the applet from the browser?  Can you see the rendering once you separate it?  That's the behavior I am seeing when the applet is running in a separate process.
Yes, in Firefox and Chrome I can command-click and separate it, and at that point can see the rendering. Setting the Java preferences to launch in a separate process has no effect in Firefox and Chrome -- it still comes up white, and I can still separate it with command-click.

It seems like the applet is running in Firefox and Chrome, it's just not rendering for some reason.
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

blainebell
In reply to this post by Wade Walker
Hi Wade,

How do I get the source code and build applet-launcher.jar and JNLPAppletLauncher.java?  I don't see it in either the gluegen or jogl repository.

Thanks,

Blaine
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

Wade Walker
Administrator
It's in https://github.com/sgothel/applet-launcher. I just downloaded the code and ran ant, and it compiled with no problems (it's really only one file). There are a couple of variables to set in the code if you want that debug output that I had coming out.

Let me know if deleting that JNLP cache works for you -- I'll add that to my eventual tutorial if so.

Reply | Threaded
Open this post in threaded view
|

Re: Mac OS Java Update ( 1.6.0_20) breaks JOGL applets

blainebell
OK, so I think I have gotten somewhere, the biggest problem I has was that I didn't write loadLibraryInternal() to call the JNLPAppletLauncher.loadLibrary() method (I am sure there is documentation somewhere, but I found it in the JNLPAppletLauncher code).

I can now get my applet running inside Safari when it is run inside the browser process. Whehew!!!

In Firefox, it does run, however, I cannot call the applet from javascript.  I use the function getSubApplet() on the applet object, but get this error:

<<< ProxyClassLoader: defined LiveConnectProxy class. >>>
<<< Here're the permissions you've got: >>>
<<< java.security.Permissions@1e9d9b1 (
 (java.net.SocketPermission localhost connect,accept,resolve)
 (java.util.PropertyPermission jep.debug.visibility read)
 (java.util.PropertyPermission jep.debug.release read)
 (java.util.PropertyPermission javaplugin.version read)
 (java.util.PropertyPermission javaplugin.vm.options read)
 (java.util.PropertyPermission jep.version read)
 (java.util.PropertyPermission browser.version read)
 (java.util.PropertyPermission jep.debug.updates read)
 (java.util.PropertyPermission http.agent read)
 (java.util.PropertyPermission browser read)
 (java.util.PropertyPermission browser.vendor read)
)
 >>>
Exception in LiveConnect getting field "public static final java.lang.Class java.lang.Void.TYPE"
java.lang.NullPointerException
        at netscape.oji.CSecureEnv.checkPackageAccess(CSecureEnv.java:115)
        at netscape.oji.CSecureEnv.access$000(CSecureEnv.java:59)
        at netscape.oji.CSecureEnv$GetField.run(CSecureEnv.java:245)
        at netscape.oji.LiveConnectProxy.run(LiveConnectProxy.java:48)
java.lang.RuntimeException
        at netscape.oji.CSecureEnv$GetField.run(CSecureEnv.java:251)
        at netscape.oji.LiveConnectProxy.run(LiveConnectProxy.java:48)

Has anyone been able to communicate from JavaScript inside Firefox?

Also, when I run the applet in its own process in Safari, I get a similar error that started this thread, which I also get when I go to the http://jogamp.org/jogl-demos/www/applettest-jnlp.html page (this is directly from this page):

java.lang.reflect.InvocationTargetException
        at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(DeployAWTUtil.java:116)
        at sun.plugin2.applet.Plugin2Manager.runOnEDT(Plugin2Manager.java:3542)
        at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3073)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
        at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.SecurityException: attempted to open sandboxed jar http://jogamp.org/deployment/webstart/jogl.all.jar as a Trusted-Library
        at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(CPCallbackHandler.java:358)
        at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(DeployURLClassPath.java:804)

Was there a fix for this, or are applets always suppose to be run inside the browser process?  Strange, since I had it working in its own process... Is there a way to get it deployed properly for both?

Thanks a lot for your help (again!)

Blaine
12