JOGL Applet Security

This error has prevented me from making anything that contains OpenGL for months:


java.lang.ExceptionInInitializerError
        at net.java.games.jogl.DefaultGLCapabilitiesChooser.<clinit>(Defaul
pabilitiesChooser.java:83)
        at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableF
y.java:136)
        at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableF
y.java:118)
        at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableF
y.java:85)
        at JOGLTest.init(JOGLTest.java:37)
        at sun.applet.AppletPanel.run(AppletPanel.java:374)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.security.AccessControlException: access denied (java.util.P
tyPermission jogl.verbose read)
        at java.security.AccessControlContext.checkPermission(AccessControl
xt.java:264)
        at java.security.AccessController.checkPermission(AccessController.
427)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:5
        at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.ja
85)
        at java.lang.System.getProperty(System.java:627)
        at net.java.games.jogl.impl.Debug$2.run(Debug.java:73)
        at java.security.AccessController.doPrivileged(Native Method)
        at net.java.games.jogl.impl.Debug.isPropertyDefined(Debug.java:71)
        at net.java.games.jogl.impl.Debug.<clinit>(Debug.java:53)
        ... 7 more

I want an OpenGL applet but it keeps getting this error. How can I use ClassLoader to fix the permissions? The reason for an applet instead for webstart because I want to make online games for websites. Another reason I want an applet because I want my web pages interactive by putting multiple applets in one page. If possible, do not let the game display a security notice because is scary for most users because they think the security notice is similar to the dangerous ActiveX notices.

Thank you VERY much.

You can’t do this without scary dialogs.

Thank you very much, Riven, for you reply! :slight_smile:

but still, How do I make the game with scary dialogs? How do I fix the errors?

Thank you very much!

I haven’t built any applets using JOGL but my understanding is that you need to both sign your applet (causing a security warning, etc. notice) as well as copy the JOGL jar file and native library into the user’s JRE. This is why we recommend deploying JOGL applications via Java Web Start. Is there a compelling reason you can’t use JWS but have to have an applet?

Thanks for your reply.

There is a reason because making a game in Java instead of C or C++ because it works in the browser, but software rendering is too slow at a high resolution. Flash and Shockwave are too slow to make online games.

Another reason is that people will get scared because JWS is similar to downloading freeware because it can contain viruses, spyware, adware, Trojan horses, bloatware, mess up the computer, and make the computer slower. When students are playing JWS games at school, teachers MIGHT think the JWS games contain viruses because it’s not played in a browser, so they will block my game site, in which I doubt, because students might be blocked from installing Java 5.0, because most schools have Windows Netscape with IE 6.0 (and Microsoft Java Virual Machine, I guess), but if the Java version is outdated, unless they told the teachers, in which I doubt, because most Java applets still work on older versions, so teachers think there’s no reason for installing a newer version that’s slower at loading the applets because of the stupid Java Logo, that sometimes crashes IE and Firefox on Windows, especially if there is a missing a class or jar file, or sometimes clicking on it, that displays before it fully loads. I know how to turn off the logo by inserting some params, but it’s the other applets. I think some administrators school computers that are good at computers that knows many things other than Microsoft Windows are smart enough to install Java 5.0, and the administrator of some school computers are not in the same school every day, if the computer teachers don’t even these have permissions, but I doubt computer teachers don’t have these permissions.

but still, how do I sign my applet to fix the errors? I tried to read the instructions on how to sign it but it didn’t work.

Thank you very much.

You are among the first that try this. I don’t know if anybody managed to do it, without putting DLLs in the JRE-dir from inside the applet (which is evil, and true horror).

Thank you for your reply.

I know they would downloaded the newer version, and has been downloaded, because most people that play on any game site downloaded the latest versions Flash player and Shockwave player. Most people play game at home, because almost ALL SCHOOLS BLOCK game sites anyway.

I’d stick with software rendering and java 1.1 if I were you.

In fact, I did not make ANY game by myself.

Java 1.1 is NOT recommended because I can just use tag for IE to check the version and download the newer version so it would show an ActiveX notice to install a newer version of Java similar to Flash and Shockwave installations.

e.g.


<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
 codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"
 width="640" height="480">
<param name="code" value="..." />
<param name="codebase" value="..." />
<param name="archive" value="..." />
...

Therefore, it is similar to the Flash player and Shockwave player installation. I noticed that people installed Java 5.0 from this method just as easy as the Flash player installation.

Thus, how do I sign a Java applet?

You can use jarsigner.exe (which comes with the JDK). Unless you actually pay for a real certificate, you will have to generate one yourself, which is effectively “untrusted” and the user will be asked to trust you.

Cas :slight_smile:

I created a Java certificate but using keytool and jarsigner but it still doesn’t have the permission.

After months of struggling to make my own Java games out of JOGL, I’ve been given up, wasting time, and debugging my source codes. I’ve been frustrated and guilty that I didn’t make any of my own Java games. Will software rendering make the game’s FPS reasonable at a 512x512? Can you show me how sign my JOGL applet correctly? Are there any example source codes?

Maybe you should try to start with a WebStart version. Not because you want to use WebStart, but because it has similair signing techniques and with WebStart it’s been proven to work, so lots of people can help you. When you have the WebStart version running, with help of us, you can try to make the next step yourself, which should be much less complex by then.

HTH

I tried to start with a webstart version but it always got an error that says “unable to launch the specified application”. How do I make my jnlp file?
Thank you very much.

The jnlp file is invalid. How do I make it valid?

We can’t correct mistakes we don’t see.

“My car is broken, how to fix it?”

So we need more information, like… what is your current JNLP file?


<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0"
codebase="http://localhost/"
      >
  <information>
    <title>JOGLTest</title>
    <vendor>Dogs</vendor>
    <homepage href="http://localhost/"/>
    <description>JOGL test</description>
    <description kind="short">JOGL test</description>
    <shortcut online="true">
      <menu submenu="Games"/>
    </shortcut>
  <offline-allowed/>
  </information>

    <resources>
      <j2se version="1.5+" initial-heap-size="128m" max-heap-size="256m"/>
      <jar href="JOGLTest.jar" main="true"/>
      <extension name="jogl" href="jogl.jnlp" />
    </resources>

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

  <application-desc main-class="JOGLTest"/>
</jnlp>
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no jogl in java.library.path
	at java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.lang.Runtime.loadLibrary0(Unknown Source)
	at java.lang.System.loadLibrary(Unknown Source)
	at net.java.games.jogl.impl.NativeLibLoader$1.run(NativeLibLoader.java:72)
	at java.security.AccessController.doPrivileged(Native Method)
	at net.java.games.jogl.impl.NativeLibLoader.load(NativeLibLoader.java:58)
	at net.java.games.jogl.impl.GLContext.<clinit>(GLContext.java:52)
	at net.java.games.jogl.impl.windows.WindowsGLContextFactory.createGLContext(WindowsGLContextFactory.java:147)
	at net.java.games.jogl.GLCanvas.<init>(GLCanvas.java:72)
	at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:150)
	at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:118)
	at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:85)
	at JOGLTest.main(JOGLTest.java:23)
	... 11 more

You reference:

<extension name="jogl" href="jogl.jnlp" />

And the exception says it can’t find the JOGL-libraries… so… what do you think we also need to see?

jogl.jnlp


<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="https://jogl.dev.java.net/webstart/"
      href="jogl.jnlp">
  <information>
    <title>JOGL</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://jogl.dev.java.net/"/>
    <description>JOGL</description>
    <description kind="short">Java programming language binding for the OpenGL 3D graphics API.</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>

    <resources>
      <jar href="jogl.jar" />
    </resources>
    <resources os="Windows">
      <nativelib href = "jogl-natives-win32.jar" />
    </resources>
    <resources os="SunOS" arch="sparc">
      <nativelib href = "jogl-natives-solsparc.jar" />
    </resources>
    <resources os="SunOS" arch="x86">
      <nativelib href = "jogl-natives-solx86.jar" />
    </resources>
    <resources os="Linux">
      <nativelib href = "jogl-natives-linux.jar" />
    </resources>
    <resources os="Mac OS X">
      <nativelib href = "jogl-natives-macosx.jar" />
    </resources>

  <component-desc />
</jnlp>

How do I make it valid???

Thank you very much.