java - Problem with writing file in servlet deployed on tomcat -
I wrote a sublet that writes an image in the root directory of my app and then requests it when it comes to GET Get the request. When I test with Jaitley in Eclipse, everything works fine (came with the GWT plugin) but when I take it in Tomcat, I get the Fontainefund exception (because the image is not written at all , So it can not return to the client) Is this problem with permissions for writing files?
I've added it to the catalina.policy file, but this is not helping either (webie is the folder of my application):
grants {permission java. Io.FilePermission "$ {catalina.home} / webapps / webui /", "Reading, writing, delete"; Permission java.io.FilePermission "$ {catalina.home} / webapps / webui / *", "read, write, delete"; };
Modifying the security policy will not help; If this was a problem with the policy, you would get the security expense
instead of a Filenotfoud exposition
. The latter indicates that the Java process is trying to open a file handle in the appropriate mode, but the operation system is being denied. The most likely reason for this is that the file (or the parent directory) is not able to execute the Java process by the user.
Take a look at the permissions on those folders that you are trying to write, and especially look at the user who you are running as a Tomcat and what effective permission they will have.
Comments
Post a Comment