We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Sometimes it works and sometimes it doesn't
Page Index Toggle Pages: 1
Sometimes it works and sometimes it doesn't (Read 1571 times)
Sometimes it works and sometimes it doesn't
Apr 24th, 2005, 8:42pm
 
Hi,
I have a 3D app that runs nicely using openGl lib in the IDE. It also runs nicely using the PD3. WHen I export it to an applet it only works with P3D. When I export in the openGL mode I get a white screen and no error messages.
I have the version 5 Java runtime on my computer and I assume that is what the browser is calling ( it fails equally in ie and mozilla)so that might be the problem.

How can I test the hypothesis that its the runtime?Or does anybody have a better idea?

Thanks in advance for any advice.
Here is a link to the applet (in P3D mode but with the openGL lib anyway):
www.physicstree.net/processing/applet
Re: Sometimes it works and sometimes it doesn't
Reply #1 - Apr 24th, 2005, 9:17pm
 
hm, you could try and run the applet using the java 1.4 that's included with processing. i think this might work:

/path/to/processing/java/bin/java sun.applet.Main index.html

perhaps more important, check the java console when running from the browser and see what sort of errors you get.

this may be a 1.5 thing, though it may just be security exceptions because gl requires native code. we haven't straightened out whether or not opengl code will be run over the web (without additional applet signing by users) but i suspect there might be some difficulty. we should probably mention this in the faq (that gl doesn't really work for export to the web and though it may in the future, it needs work).
Console output -security ?!?
Reply #2 - Apr 25th, 2005, 1:29am
 
Here is the Java console output when I try to run the openGL enabled version in the browser: (slightly edited)
--------------------

Java Plug-in 1.5.0_02
Using JRE version 1.5.0_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\John Dell

<some garbage I took out>

Exception in thread "Thread-5" java.lang.ExceptionInInitializerError
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at processing.core.PApplet.size(PApplet.java:716)
     at sketch_projectedSphere.setup(sketch_projectedSphere.java:22)
     at processing.core.PApplet.display(PApplet.java:1008)
     at processing.core.PGraphics.requestDisplay(PGraphics.java:362)
     at processing.core.PApplet.run(PApplet.java:916)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.cpu.endian read)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
     at java.lang.System.getProperty(Unknown Source)
     at processing.opengl.PGraphicsGL.<clinit>(PGraphicsGL.java:48)
     ... 8 more

------

I will try the other plug in but it appears that security was the issue..at least as far as I can read this cryptic response....and its too bad. Processing load is a real issue with the apps I have in mind ( I know, when is it not?)  and I salivate as I watch the great gain in speed when the openGL hardware gets to come online.

So, if this is a block for the moment, I will look to see about distributing an app outside the browser environment.

Thanks again for all the nice work...jd

Re: Sometimes it works and sometimes it doesn't
Reply #3 - Apr 25th, 2005, 1:51am
 
Just to round the information out, here is the failure data from mozilla installation of the 1.3 Java Plugin...seems a little different than the version 5 report ...but its not version 5 alone causing the problem..
-----
Java(TM) Plug-in: Version 1.3.1_08
Using JRE version 1.3.1_08 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\John Dell

Proxy Configuration: Browser Proxy Configuration



java.lang.UnsupportedClassVersionError: net/java/games/jogl/GLEventListener (Unsupported major.minor version 48.0)

     at java.lang.ClassLoader.defineClass0(Native Method)

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

     at java.security.SecureClassLoader.defineClass(Unknown Source)

     at java.net.URLClassLoader.defineClass(Unknown Source)

     at java.net.URLClassLoader.access$100(Unknown Source)

     at java.net.URLClassLoader$1.run(Unknown Source)

     at java.security.AccessController.doPrivileged(Native Method)

     at java.net.URLClassLoader.findClass(Unknown Source)

     at sun.applet.AppletClassLoader.findClass(Unknown Source)

     at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)

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

     at sun.applet.AppletClassLoader.loadClass(Unknown Source)

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

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

     at java.lang.Class.forName0(Native Method)

     at java.lang.Class.forName(Unknown Source)

     at processing.core.PApplet.size(PApplet.java:716)

     at sketch_projectedSphere.setup(sketch_projectedSphere.java:22)

     at processing.core.PApplet.display(PApplet.java:1008)

     at processing.core.PGraphics.requestDisplay(PGraphics.java:362)

     at processing.core.PApplet.run(PApplet.java:916)

     at java.lang.Thread.run(Unknown Source)

------
I guess that puts an end to that...if you all find a fix for this I would love to hear about..
-jd
Re: Sometimes it works and sometimes it doesn't
Reply #4 - Apr 25th, 2005, 2:36am
 
actually, you've uncovered two totally separate errors:

the java 1.5 version is having trouble because sun.cpu.endian is not available to applets (which is required for ordering the data properly). though if that's the case, we can work around it. i'll make a note to look into it when i have a chance.

in the other version, you're running into the fact that opengl doesn't run on java 1.3.
No OPENGL in exported applets
Reply #5 - Dec 15th, 2005, 9:22am
 
I am using a very simple sketch. It runs fine in the IDE, however it will not run in any of the browsers.

The java version I am using is as follows.

Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)

Here is the sketch:
import processing.opengl.*;

void setup() {
 size(100,100,OPENGL);
}

void draw() {
 background(204);
 line(0,0,100,100);
}

After exporting and loading the applet in a browser the following exception is recorded in the JVM console:

Exception in thread "Thread-213" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at processing.core.PApplet.size(PApplet.java:800)
at openglbug.setup(openglbug.java:4)
at processing.core.PApplet.display(PApplet.java:1144)
at processing.core.PGraphics.requestDisplay(PGraphics.java:520)
at processing.core.PApplet.run(PApplet.java:1028)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.cpu.endian read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at processing.opengl.PGraphicsGL.<clinit>(PGraphicsGL.java:77)
... 8 more

Is there perhaps a better way to get the endianess of the architecture besides through sun.cpu.endian?

Thanks,
Casey Watson
Page Index Toggle Pages: 1