Bug 782 - AccessControlException using jogl.debug.TextRenderer in applet
Summary: AccessControlException using jogl.debug.TextRenderer in applet
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: applet (show other bugs)
Version: 2
Hardware: All all
: --- major
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-07-12 17:51 CEST by martinezmj
Modified: 2013-07-17 04:33 CEST (History)
0 users

See Also:
Type: ---
SCM Refs:
gluegen d27d802b4e11745969909229a2d1f0963c74ce3a joal b4fbbc98929c56b9f82815a50dacb02796d9d252 jogl 8ac3f344aded383ca9a3083a877af7bfdf6e1e48
Workaround: TRUE


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martinezmj 2013-07-12 17:51:17 CEST
Any use of com.jogamp.opengl.util.awt.TextRenderer in an applet results in a AccessControlException when the TextRenderer class loads.

Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "jogl.debug.TextRenderer" "read")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
	at java.security.AccessController.checkPermission(AccessController.java:559)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
	at java.lang.System.getProperty(System.java:707)
	at com.jogamp.common.util.PropertyAccess.getProperty(PropertyAccess.java:146)
	at com.jogamp.common.util.PropertyAccess.isPropertyDefined(PropertyAccess.java:109)
	at com.jogamp.opengl.util.awt.TextRenderer.<clinit>(TextRenderer.java:131)
	... 43 more

JOGL being loaded via http://jogamp.org/deployment/jogamp-current/jar/jogl-all.jar.  These results are for an unsigned applet. Setting property "jnlp.jogl.debug.TextRenderer" in the JNLP did not fix the issue.  I see the same issue in both Mac and Windows.

See this thread for more discussion of this issue:
http://forum.jogamp.org/AccessControlException-using-jogl-debug-TextRenderer-in-applet-td4029580.html
Comment 1 Sven Gothel 2013-07-17 04:30:37 CEST
Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to
'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization.

Iff that happens, an AccessControlException may happen, due to requesting an insecure property,
since modules own Debug class has not been added it's trusted prefixes from within it's init block yet.

This seems to be a bug of the JVM .. to me, however .. the above description is the only
able to explain the issue at hand.

.. Naturally, Debug class should be initialized before calling it's parent isPropertyDefined(..)!
Comment 2 Sven Gothel 2013-07-17 04:33:09 CEST
Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(),
before calling 'isPropertyDefined(propName, default)'.

+++

Also mark Debug class static methods final!

+++

Marked as a workaround, since a JVM bug is assumed!