0

I'm using ini4j in my program and it works perfectly when i launch it. The problem is when I launch it as an applet (from a website). Before I use ini4j, the applet worked but now i get this :

Tue Mar 12 14:19:26 CET 2013 ERROR:access denied ("java.util.PropertyPermission" "user.dir" "read")
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 java.io.File.toURI(Unknown Source)
    at org.ini4j.Ini.load(Ini.java:114)
    at org.ini4j.Ini.load(Ini.java:99)
    at org.ini4j.Ini.<init>(Ini.java:69)
    at GameState.init(GameState.java:53)
    at Main.initStatesList(Main.java:29)
    at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
    at org.newdawn.slick.AppletGameContainer$Container.initApplet(AppletGameContainer.java:272)
    at org.newdawn.slick.AppletGameContainer$ContainerPanel.initGL(AppletGameContainer.java:229)
    at org.newdawn.slick.AppletGameContainer$ContainerPanel.start(AppletGameContainer.java:216)
    at org.newdawn.slick.AppletGameContainer$1.run(AppletGameContainer.java:92)

The code when it happen :

try {
            ini = new Ini(new File("res/config.ini"));
        } catch (InvalidFileFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
4

0 回答 0