Tomcat Deploy: Base directory and file permission

71 views
Skip to first unread message

Francisco

unread,
Apr 24, 2009, 12:05:45 PM4/24/09
to Google Web Toolkit
Hello,
I wrote a gwt application where one of its services must write on the
disk, let's say the file "./data/myfile.txt". On hostmode it works
perfectly, but when I deploy it on my tomcat (running on linux), I get
an "access denied (java.io.FilePermission)".

I've already changed my tomcat permission policies but without any
success. I tried all the following:

grant codeBase "file:${catalina.base}/webapps/MyApp/-" {
...
some permissions
...
permission java.io.FilePermission "$
{catalina.base}/-","read,write";
permission java.io.FilePermission "$
{catalina.home}/-","read,write";
permission java.io.FilePermission "file:$
{catalina.home}/-","read,write";
permission java.io.FilePermission "file:$
{catalina.home}/-","read,write";
permission java.io.FilePermission "/usr/share/tomcat6/
bin/-","read,write"; (I tried this one because I thought that the "./"
directory might be located in the same place where tomcat is
executed.)
}

So, I have two problems:
1) Where is the "./" directory (base directory) when referenced from
my gwt application located? I need to know that because it could be
some "chown" or "chmod" issue.
2) How to force tomcat allowing disk access to my application?

Any help is welcome.
Regards,
Francisco de Assis.
Reply all
Reply to author
Forward
0 new messages