i have a similar problem with an xml file that i try to read..
the code for read is:
try {
   File fileXml = new File("./vini.xml");
   System.out.println("hi");
   System.out.println("owner's write permission :
"+fileXml.setWritable(true));  //exception cached
   System.out.println("owner's read permission :
"+fileXml.setReadable(true));
   ...
}
catch (Exception e) {
                    lst += e;   //browser output
                    e.getStackTrace();   //console output
                }

while debugging the output in the browser is:
java.security.AccessControlException: access denied
(java.io.FilePermission ./vini.xml write)
if i don't set the fileXml.setWritable(true) it works fine! but not
when i deploy the app in tomcat6

where can i set the permissions?
i tried to add this
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
        permission java.security.AllPermission;
};
in /etc/tomcat6/policy.d/03catalina.policy but it doesn't work....

On Apr 6, 3:44 pm, HDayi <[email protected]> wrote:
> i am trying to open the file with the fallowing code:
>
> BufferedReader input =  new BufferedReader(new
> FileReader("blabla.txt"));
>
> it works while developping with eclipse.
> and i am trying to write whit the fallowing:
>
> BufferedWriter out = new BufferedWriter(new FileWriter("blabla.txt"));
> out.write(liste);
> out.close();
>
> both works fine on eclipse.
> when i upload to server the first one gives a long error message
> saying "file not found" in tomcat log file as i mentioned before.
> second one gives onli on word in tomcat log "Exception".

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to