当前位置: 技术问答>java相关
applet的安全限制真是烦死人了!!连sun.misc也不行?
来源: 互联网 发布时间:2017-03-20
本文导语: 我的applet中用到了sun.misc包中有关base64 编码解码的类; 结果使用时出现例外: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.misc) at java.security.AccessControlContext.checkPermission(Unknown Sourc...
我的applet中用到了sun.misc包中有关base64 编码解码的类;
结果使用时出现例外:
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.misc)
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.checkPackageAccess(Unknown Source)
at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
干脆我把sun.misc中用到的两个类BASE64Encoder和 BASE64Decoder也打包到applet里面去了,结果还是上面一样的错!!!
怎么回事?
sun.misc不是rt.jar里面有的东东吗,怎么还有安全问题?
不用签名,哪位大侠有办法?
|
billion_delly(), the Base64 integration is currently hosed. We've an issue open on it:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9931
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9931
|
modify java.policy file(under jre folder typically C:Program FilesJavaSoftJRE1.4libsecurity)
grant codeBase "http://127.0.0.1/test/myjarfile.jar" {
permission java.security.AllPermission;
};
modify the codBase string according to your applet html.
grant codeBase "http://127.0.0.1/test/myjarfile.jar" {
permission java.security.AllPermission;
};
modify the codBase string according to your applet html.