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

蓝咒 提交于 2019-12-14 01:04:47

问题


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

回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/4689123/java-security-accesscontrolexception-access-denied-java-io-filepermission-usr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!