You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Teemu Hiltunen <th...@uta.fi> on 2001/10/12 09:06:40 UTC

Velocity 1.2rc1 + Tomcat 4.0 with security policy

Greetings!

I'm having a problem while using Velocity 1.2rc1 with Tomcat 4.0. I'm
starting Catalina with -security option because I intend to use servlets
as Jini clients (or something like that, I haven't got so far yet).
Without the -security option I can get the Velocity sample servlets to
work just fine but with the security policy it won't work. I have added
the following into Tomcat's conf/catalina.policy file:

// These permissions are for Velocity servlet examples for logging
// purposes.
grant codeBase
"file:${catalina.home}/webapps/velexample/WEB-INF/lib/velocity-1.2-rc1.jar!/-"
{
        permission java.security.AllPermission;
};
grant codeBase
"file:${catalina.home}/webapps/velexample/WEB-INF/classes/-" {
        permission java.security.AllPermission;
};
grant codeBase "file:${catalina.home}/webapps/velexample/-" {
        permission java.security.AllPermission;
};

At first, I tried it with just the first 'grant' but even with all three
it won't work.
I keep getting the following errors from Catalina when accessing
http://localhost:8080/velexample/servlet/SampleServlet :

PANIC : Error configuring AvalonLogSystem :
java.security.AccessControlException: access denied
(java.io.FilePermission
 /home/teemu/jakarta-tomcat-4.0/webapps/velexample read)
PANIC : Error configuring AvalonLogSystem :
java.security.AccessControlException: access denied
(java.io.FilePermission
 /home/teemu/jakarta-tomcat-4.0/webapps/velexample read)
java.lang.Exception: Unable to configure AvalonLogSystem :
java.security.AccessControlException: access denied (java.io
.FilePermission /home/teemu/jakarta-tomcat-4.0/webapps/velexample read)
java.lang.Exception: Unable to configure AvalonLogSystem :
java.security.AccessControlException: access denied (java.io
.FilePermission /home/teemu/jakarta-tomcat-4.0/webapps/velexample read)
....

I do have checked that I have read (and write) permissions to webapps
directory and all its subdirectories and files in them. So, the problem
has to be in my catalina.policy file and its 'grant' statements, right?

I thank thee for thy time and any assistance in this matter.


Teemu Hiltunen