AccessControlException on Applet

Hi, I'm trying the JME applet examples on the browser, when I deploy and try, for example, AppletTestBoxColor, I get the following exception:



java.lang.ExceptionInInitializerError
   at com.jme.system.DisplaySystem.getDisplaySystem(Unknown Source)
   at com.jmex.awt.applet.SimpleJMEApplet.init(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.logging.LoggingPermission control)
   at java.security.AccessControlContext.checkPermission(Unknown Source)
   at java.security.AccessController.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkPermission(Unknown Source)
   at java.util.logging.LogManager.checkAccess(Unknown Source)
   at java.util.logging.Logger.setLevel(Unknown Source)
   at com.jme.util.LoggingSystem.loggerOn(Unknown Source)
   at com.jme.util.LoggingSystem.<init>(Unknown Source)
   at com.jme.util.LoggingSystem.getLogger(Unknown Source)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.<init>(Unknown Source)
   at com.jme.system.lwjgl.LWJGLSystemProvider.<clinit>(Unknown Source)
   ... 4 more



I tested the LWJGL applet examples and they are working ok; the html file is:


<applet code="AppletTestBoxColor"
   archive="jengibre.jar,lwjgl_util_applet.jar,lwjgl.jar,jme.jar,natives.jar,jme-awt.jar,jme-terrain.jar,jme-effects.jar"
   width="800"
   height="600">
  <param name="useAppletCanvasSize" value="true"/>
</applet>



with jengibre.jar being the jar with the sample applets

I assume the problem is with the signed applet, perhaps I should sign the code (i.e. the jengibre.jar?)

Thanks

You have to sign your jars.



Also:

http://www.jmonkeyengine.com/wiki/doku.php?id=writing_a_jme_applet

Thanks llama



I've signed the jars and now the problem is the (in)famous



INFO: LWJGL Display System created.
java.lang.UnsatisfiedLinkError: no lwjgl 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 org.lwjgl.Sys$1.run(Sys.java:75)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
   at org.lwjgl.Sys.loadLibrary(Sys.java:84)
   at org.lwjgl.Sys.<clinit>(Sys.java:101)
   at com.jme.util.lwjgl.LWJGLTimer.<clinit>(Unknown Source)
   at com.jme.system.lwjgl.LWJGLSystemProvider.<clinit>(Unknown Source)
   at com.jme.system.DisplaySystem.getDisplaySystem(Unknown Source)
   at com.jmex.awt.applet.SimpleJMEApplet.init(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)



As the LWJGL applet examples have worked, I assume it's some dark problem besides LWJGL unable to do the temp installation... is there any other step required?

To recap: I've signed my jar and the jme-*.jar files, the lwjgl*.jar are already signed... maybe that's a problem?

Thanks

Did you include the natives.jar as mentioned in the wiki?

Yes, this is the code of the HTML file



<applet code="AppletTestBoxColor"
   archive="jengibre.jar,lwjgl_util_applet.jar,lwjgl.jar,jme.jar,natives.jar,jme-awt.jar,jme-terrain.jar,jme-effects.jar"
   width="800"
   height="600">
  <param name="useAppletCanvasSize" value="true"/>
</applet>



All those jar files are accesible on the server

Well… it works for me. I also don't resign the LWJGL jars.



Which version of natives.jar did you download? And is that the only exception you're getting or are there any before that?

This is the complete stack trace of the applet console:



18/09/2006 12:05:22 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
java.lang.UnsatisfiedLinkError: no lwjgl 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 org.lwjgl.Sys$1.run(Sys.java:75)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
   at org.lwjgl.Sys.loadLibrary(Sys.java:84)
   at org.lwjgl.Sys.<clinit>(Sys.java:101)
   at com.jme.util.lwjgl.LWJGLTimer.<clinit>(Unknown Source)
   at com.jme.system.lwjgl.LWJGLSystemProvider.<clinit>(Unknown Source)
   at com.jme.system.DisplaySystem.getDisplaySystem(Unknown Source)
   at com.jmex.awt.applet.SimpleJMEApplet.init(Unknown Source)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)



I'm using the natives.jar from the lwjgl_applettest-1.0beta3 version

jME uses beta1 I believe. Try that one.

I tried with the native.jar and jar files from LWJGL Beta 2 (the first release that included applet support), and no luck, same error  :frowning:

This works for me:


<applet

Still doesn’t work  :cry:



I have the same natives.jar as you, and the error keeps popping, I’ve tried signing all jars and only jme jars and neither does work… bummer



Also tried to include windows_natives.jar in the applet archive tag (instead of natives.jar), and nothing



An online (non functioning) version is at http://www.jengibre.com.ar/opengl/jme.html

Small update: If I delete the natives.jar, the error is the same, so I suppose it isn't finding the natives… any clues?



thanks again :slight_smile:

lwjgl unpacks the natives.jar to a temp folder on your machine for applets to work.  The list of jars I've always needed for a basic app (aside from the jar with my own code in it) was:



lwjgl_util_applet.jar

lwjgl.jar

jme.jar

natives.jar

I got it, the problem was that I was using the jar files from the CVS repository, which don't include the latest classes and doesn't do the temp install, I solved it downloading the nightly build and using those jars  :smiley:



BTW, when trying to build the source files from the CVS (using Eclipse) I get the following errors:



Buildfile: C:eclipseworkspacejMEbuild.xml
Overriding previous definition of reference to classpath
init:
     [echo] jmeKeyStore
compile:
    [javac] Compiling 1403 source files to C:eclipseworkspacejMEbuild
    [javac] C:eclipseworkspacejMEsrccomjmexgameStandardGame.java:275: reference to GameStateManager is ambiguous, both class com.jmex.game.state.GameStateManager in com.jmex.game.state and class com.jme.app.GameStateManager in com.jme.app match
    [javac] GameStateManager.create();
    [javac] ^
    [javac] C:eclipseworkspacejMEsrccomjmexgameStandardGame.java:284: reference to GameStateManager is ambiguous, both class com.jmex.game.state.GameStateManager in com.jmex.game.state and class com.jme.app.GameStateManager in com.jme.app match
    [javac] GameStateManager.getInstance().update(interpolation);
    [javac] ^
    [javac] C:eclipseworkspacejMEsrccomjmexgameStandardGame.java:306: reference to GameStateManager is ambiguous, both class com.jmex.game.state.GameStateManager in com.jmex.game.state and class com.jme.app.GameStateManager in com.jme.app match
    [javac] GameStateManager.getInstance().render(interpolation);
    [javac] ^
    [javac] C:eclipseworkspacejMEsrccomjmexgameStandardGame.java:340: reference to GameStateManager is ambiguous, both class com.jmex.game.state.GameStateManager in com.jmex.game.state and class com.jme.app.GameStateManager in com.jme.app match
    [javac] GameStateManager.getInstance().cleanup();
    [javac] ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 4 errors

BUILD FAILED
C:eclipseworkspacejMEbuild.xml:52: Compile failed; see the compiler error output for details.

Total time: 50 seconds



Haven't even looked at it, probably is a configuration error of my own, but in case you want to take a look at it (I'm synchronized with the CVS repository)

Thanks a lot llama and renanse!

com.jme.app.GameStateManager is no longer in CVS (all the gamestate stuff is in jmex now).

minor correction…it's still in CVS, just a different place (under jmex instead of jme now). :slight_smile:

I think you are both saying the same thing :wink:

Using the eclipse ant, I couldn't build jME, had to organize imports in StandardGame class, here's a patch





Index: StandardGame.java

===================================================================

RCS file: /cvs/jme/src/com/jmex/game/StandardGame.java,v

retrieving revision 1.1

diff -u -r1.1 StandardGame.java

— StandardGame.java 14 Aug 2006 22:48:14 -0000 1.1

+++ StandardGame.java 19 Sep 2006 14:49:30 -0000

@@ -31,14 +31,14 @@

  /

package com.jmex.game;



-import java.util.concurrent.
;

+import java.util.concurrent.Callable;

import java.util.logging.Level;

import java.util.prefs.Preferences;



-import com.jme.app.;

+import com.jme.app.AbstractGame;

import com.jme.image.Texture;

import com.jme.input.InputSystem;

-import com.jme.input.joystick.
;

+import com.jme.input.joystick.JoystickInput;

import com.jme.math.Vector3f;

import com.jme.renderer.Camera;

import com.jme.renderer.ColorRGBA;

@@ -56,7 +56,7 @@

import com.jme.util.NanoTimer;

import com.jme.util.TextureManager;

import com.jme.util.Timer;

-import com.jmex.game.state.*;

+import com.jmex.game.state.GameStateManager;

import com.jmex.model.XMLparser.Converters.DummyDisplaySystem;

import com.jmex.sound.openAL.SoundSystem;





It's weird how the nightly build are working fine…  :?



Regards


Uhm, well…



The only thing that patch could ever do is break something, not fix it, since it now imports a subset of what you used to import.



Except with you apperently… you're special :slight_smile:

I still don't understand how it's working, because I'm synchronized and have the latest CVS  :?



Anyway… as you people say: if it works… don't fix it



thanks