Java 策略文件无法为代码库 jar 分配权限
我已经编写了我的 java 策略文件,以向名为“xyz.jar”的 jar 授予 allPermission,
grant codebase "file:lib/xyz.jar" {
permission java.security.AllPermission;
};
但是在执行程序时,我收到 属性权限 的 AccessControlException。该属性由 jar 中的类设置。
在进行策略调试时,以下是条目:
policy: evaluate codesources:
Policy CodeSource: (file:/C:/path/lib/xyz.jar <no signer certificates>)
Active CodeSource: (file:/C:/path/lib/log4j-1.2.9.jar <no signer certificates>)
policy: evaluation (codesource) failed
以及
policy: evaluate codesources:
Policy CodeSource: (null <no signer certificates>)
Active CodeSource: (file:/C:/path/lib/xyz.jar <no signer certificates>)
policy: evaluate principals:
Policy Principals: [com.abc.MyLoginModule/principalA]
Active Principals: []
policy: evaluation (principals) failed
我哪里出错了?
I have written my java policy file to give allPermission to a jar say "xyz.jar"
grant codebase "file:lib/xyz.jar" {
permission java.security.AllPermission;
};
But while executing the program I get a AccessControlException for a property permission. This property is set by a class in the jar.
While doing the policy debugging following are the entries:
policy: evaluate codesources:
Policy CodeSource: (file:/C:/path/lib/xyz.jar <no signer certificates>)
Active CodeSource: (file:/C:/path/lib/log4j-1.2.9.jar <no signer certificates>)
policy: evaluation (codesource) failed
and
policy: evaluate codesources:
Policy CodeSource: (null <no signer certificates>)
Active CodeSource: (file:/C:/path/lib/xyz.jar <no signer certificates>)
policy: evaluate principals:
Policy Principals: [com.abc.MyLoginModule/principalA]
Active Principals: []
policy: evaluation (principals) failed
Where am I going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论