4

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; };
Panayiotis Karabassis
  • 2,278
  • 3
  • 25
  • 40
  • Tomcat 5.5 is quite old. Do you really need this old version? Maybe your problem is gone, if you use a newer version. – Christian Kuetbach Jan 14 '11 at 10:43
  • It ships with Debian Lenny and I didn't want to install my own version. I'm doing this on a local server just for testing purposes, I hope a more recent version of Tomcat will be available in the production environment. – Panayiotis Karabassis Jan 14 '11 at 11:31

2 Answers2

5

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

Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
3

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

Yuval Rimar
  • 1,055
  • 12
  • 22
  • 1
    Its a message from the Java Security-Manager not the filesystem. A class within this path tries to access an file, which is not allowed by the policy. – Christian Kuetbach Jan 14 '11 at 10:41