简体   繁体   中英

java.security.AccessControlException: access denied when running applet on browser

I am getting the following error when trying to run an applet in a browser. The applet in question contains file access code in it:

java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.RGENGINEJAVA) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.System.getenv(Unknown Source) at com.socp.components.SOCPMapViewer.bootstrapArcobjectsJar(SOCPMapViewer.java:668) at com.socp.components.SOCPMapViewer.init(SOCPMapViewer.java:130) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception: java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.RGSENGINEJAVA)

The applet works fine when invoked from the Elipse IDE but when I use an HTML file to run it in a browser it gives the above shown error. Please help me to resolve this issue. Tell me how I can grant the following permission file in the HTML context:

grant {
  permission java.security.AllPermission;
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM