开发者

Java policy file cannot assign permissions to a codebase jar

开发者 https://www.devze.com 2023-02-18 18:58 出处:网络
I have written my java policy file to give allPermission to a jar say \"xyz.jar\" grant codebase \"file:lib/xyz.jar\" {

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 Princi开发者_运维问答pals: []

policy: evaluation (principals) failed

Where am I going wrong?

0

精彩评论

暂无评论...
验证码 换一张
取 消