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

I am trying to deploy a Tomcat 5.5 application on Debian Lenny. I get 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.

Decision

Add the following line to / etc / tomcat 5.5 / policy.d / 04webapps.policy:

 grant codeBase "file:/var/lib/tomcat5.5/webapps/mywebapp/-" { permission java.security.AllPermission; }; 
+4
source share
2 answers

I smell like a SecurityManager.

This message is from Java Security-Manager not from the file system. The class inside this jar archive is trying to access a file that is not allowed by the policy.

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

Ist solution allows you to read files in catalina.policy

+5
source

try to run root chmod +r /usr/share/java/jsp-api-2.0.jar

+3
source

Source: https://habr.com/ru/post/1335512/


All Articles