java.security.AccessControlException: access denied (java.io.FilePermission /usr/share/java/jsp-api-2.0.jar read)(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 安全管理器的消息,而不是来自文件系统的消息.此 jar-archive 中的类尝试访问策略不允许的文件.
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/
解决方案是允许读取 catalina.policy
这篇关于java.security.AccessControlException:访问被拒绝(java.io.FilePermission/usr/share/java/jsp-api-2.0.jar 读取)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:java.security.AccessControlException:访问被拒绝(java.io.FilePermission/usr/share/java/jsp-api-2.0.jar 读取)
基础教程推荐
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- JPA惰性列表上的流 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
