views:

81

answers:

1

Hello,

I have built web application for use in Tomcat. It depends on Spring. I have the following exception when trying to access it:

java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)

I read tomcat docs, and found that I need to configure security. I added following lines to
"/usr/share/tomcat/conf/catalina.policy":

grant codeBase "file:${catalina.home}/webapps/MyProject/-" {
    permission java.lang.RuntimePermission;
};

But it didn't help. To add, I installed Tomcat by pasting following commands:

sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf

I have restarted server. The project exist in specified location.

What am I doing wrong?

I would really like to modify as few things on server as it is possible, without copying additional jars into servers lib folder.


My

Tomcat version = Apache Tomcat/6.0.20

Spring version = 3.0.1.RELEASE


The stack trace is too big to post it here, so please, follow link to see it.


Can anybody help me? To add, it is executed without exceptions on my Apache Geronimo.

A: 

I wouldn't use those symbolic links. Instead I would deploy at $CATALINA_BASE/webapps (check out /etc/init.d/tomcat6). Then in the policy file (/etc/tomcat6/policy.d/03catalina.policy):

grant codeBase "file:${catalina.base}/webapps/MyProject/WEB-INF/lib/-" {
    permission java.lang.RuntimePermission "createClassLoader";
};

Another option can be editing /etc/tomcat6/policy.d/04webapps.policy.

That worked for me some time ago.

Regards.

mrrtnn