简体   繁体   English

跟踪java.security.AccessControlException的来源

[英]Tracking down the source of java.security.AccessControlException

I have a Java applet which sometimes throws a java.security.AccessControlException whenever I call File.exists(). 我有一个Java小程序,每当我调用File.exists()时,有时都会抛出java.security.AccessControlException。 The problem goes away whenever I enclose the operation in an AccessController.doPrivileged() block. 只要将操作包含在AccessController.doPrivileged()块中,问题就会消失。 However, I can't figure out why. 但是,我不知道为什么。 My applet is signed and should be fully trusted. 我的applet已签名,应该被完全信任。 In other scenarios, it can read/write to files without any problems. 在其他情况下,它可以读/写文件而没有任何问题。

Is there a way to walk up my calling stack and examine the effective permissions so that I can see who or what is trusted/untrusted? 有没有办法提高我的调用堆栈并检查有效权限,以便我可以看到谁/什么是受信任/不受信任的?

You should enable java.security.debug property with access:stack first. 您应该首先使用access:stack启用java.security.debug属性 It will help you understand what permission is lacking to the domain. 它将帮助您了解域缺少什么权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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