Application throws security exception when starting as Applet

Hey Community,



Whenever I start my application as web start I get the same problem:



[java]

java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir 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 java.io.Win32FileSystem.getUserPath(Unknown Source)

at java.io.Win32FileSystem.resolve(Unknown Source)

at java.io.File.getAbsolutePath(Unknown Source)

at java.io.File.getAbsoluteFile(Unknown Source)

at com.jme3.system.Natives.getExtractionDir(Natives.java:61)

at com.jme3.system.Natives.extractNativeLibs(Natives.java:216)

at com.jme3.system.JmeDesktopSystem.initialize(JmeDesktopSystem.java:275)

at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:194)

at com.jme3.system.JmeSystem.newContext(JmeSystem.java:107)

at com.jme3.app.Application.start(Application.java:378)

at com.jme3.app.Application.start(Application.java:359)

at com.jme3.app.SimpleApplication.start(SimpleApplication.java:135)

at GUI.Main.main(Main.java:37)

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(Launcher.java:1809)

at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)

at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)

at com.sun.javaws.Launcher.run(Launcher.java:130)

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

[/java]



Do you have any ideas why Application needs permission on user folders?

Thank you for any help.



Garymedas

You somehow don’t create the applet right, since its containing native libraries the setup is a bit more complicated, its explained on the lwjgl homepage. You can also just use the SDK which sets the AppletHarness and lwjgl binaries up automatically.

I did use the SDK to generate the Applet. Haven’t said that, sorry. Do I have to consider anything when building it?

Ok sorry, I now solved the problem by signing my application, but I still don’t get it to work as an applet ON a website. It just loads 90% and then stucks.

I see you’re using Java WebStart applet, that is not the preferred way. You have to go to the project settings and then enable applets in the build settings.



If you still want to use Java WebStart, you have to include the lwjgl extension (http://lwjgl.org/webstart/2.8.2/extension.jnlp) in the WebStart options and then call JmeSettings.setLowPermissions(true) in your applet’s init() method