java.security.AccessControlException: Access Denied Error

文章目录

描述

The following error occurs from an application client or in the server.log:

java.security.AccessControlException: access denied
(java.util.PropertyPermission name write…
There is a permissions issue in the policy files. Either the client.policy for the application client or the server.policy for server side components does not have permission to set the property.

解决

Add the permission in client.policy (for the application client), or in server.policy (for EJB/web modules) for the application that needs to set the property. By default, applications only have “read” permission for properties.

For example, to grant read/write permission for all the files in the codebase directory, add or append the following to client.policy or server.policy:

grant codeBase "file:/.../build/sparc_SunOS/sec/-" {
   permission java.util.PropertyPermission "*", "read,write";
 };

参考:https://docs.oracle.com/cd/E19830-01/819-4726/fxxzk/index.html

到运行的$JAVA_HOME中查找xx.policy文件,再在里边内容做修改即可

find . -type f -name "*.policy"

注意:本地运行没这样问题而生产有,则可考虑生产对应的文件被修改从而影响了本来程序(可考虑还原配置来确定是什么配置影响了)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大怀特

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值