I'm having trouble creating a file in Java through Tomcat.

I'm using Tomcat5.5 on Ubuntu 6.10.

I'm trying to create a file from inside a servlet:

       File auditLogFile = new File(getInitParameter("audit.log"));

When I get to this line, this is the error that is thrown:

SEVERE: StandardWrapper.Throwable
java.security.AccessControlException: access denied (java.io.FilePermission /var/log/tomcat5.5/audit_log.log read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
       at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
       at java.io.File.exists(File.java:700)
       at org.test.util.Init.init(Init.java:121)
      ...

Now, I have previously created this file and given it the same permissions as other files that Tomcat generates:

-rw-r--r-- 1 tomcat5 nogroup      2 2007-01-19 17:21 audit_log.log

Compared to:

-rw-r--r-- 1 tomcat5 nogroup 138259 2007-01-19 17:24 catalina_2007-01-19.log

The second log file is one that Tomcat generates itself, and so I copied the permissions from that.
What else could be causing this?

Or is this problem not related to Tomcat at all?

Thanks,
Jacob

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to