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

查看:145
本文介绍了java.security.AccessControlException:访问被拒绝(读取java.io.FilePermission /usr/share/java/jsp-api-2.0.jar)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)

我不确定该怎么做。

解决方案

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

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; };


推荐答案

我闻起来像是SecurityManager。

I smells like an SecurityManager.

这是来自Java Security-Manager而不是文件系统的消息。此jar归档文件中的类尝试访问文件,但策略不允许。

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.

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

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

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

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

这篇关于java.security.AccessControlException:访问被拒绝(读取java.io.FilePermission /usr/share/java/jsp-api-2.0.jar)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆