java.security.AccessControlException:访问被拒绝(java.io.FilePermission /usr/share/java/jsp-api-2.0.jar 读取)

发布于 2024-10-12 03:51:07 字数 434 浏览 12 评论 0原文

我正在尝试将应用程序部署到 Debian Lenny 上的 Tomcat 5.5。我收到以下异常:

java.security.AccessControlException: access denied (java.io.FilePermission /usr/share/java/jsp-api-2.0.jar read)

我不知道该怎么做。

解决方案

将以下行添加到 /etc/tomcat5.5/policy.d/04webapps.policy:

grant codeBase "file:/var/lib/tomcat5.5/webapps/mywebapp/-" { permission java.security.AllPermission; };

I am trying to deploy me application to Tomcat 5.5 on Debian Lenny. I am getting the following exception:

java.security.AccessControlException: access denied (java.io.FilePermission /usr/share/java/jsp-api-2.0.jar read)

I'm not sure what to do.

Solution

Add the following line to /etc/tomcat5.5/policy.d/04webapps.policy:

grant codeBase "file:/var/lib/tomcat5.5/webapps/mywebapp/-" { permission java.security.AllPermission; };

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫卆 2024-10-19 03:51:07

我闻起来像个安全经理。

这是来自 Java 安全管理器的消息,而不是来自文件系统的消息。此 jar 存档中的类尝试访问策略不允许的文件。

看看这个非常相似的问题: http://www .mkyong.com/tomcat/tomcat-javasecurityaccesscontrolexception-access-denied-loggingproperties-read/

解决方案是允许读取 catalina.policy 中的文件

I smells like an SecurityManager.

It is a message from the Java Security-Manager not from the filesystem. A class within this jar-archive tries to access a file, which is not allowed by the policy.

Take a look at this really similar problem: http://www.mkyong.com/tomcat/tomcat-javasecurityaccesscontrolexception-access-denied-loggingproperties-read/

The Solution ist to allow reading of files in the catalina.policy

傾旎 2024-10-19 03:51:07

尝试以 root 身份执行 chmod +r /usr/share/java/jsp-api-2.0.jar

try executing as root chmod +r /usr/share/java/jsp-api-2.0.jar

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文