I am trying to get my J2EE application which I have deployed in a SUN application server 8.1 to write .xml FILES which can be removed by any UNIX account.
Ok I can write the file OK. My problem comes when I try to set the file permissions at the UNIX level. It seems that (quite reasonably) the file the app/app server creates has the persmissions of the app server 'owner' - root. I want the files that the app/app server creates to have rw permissions for all. i.e. I want to run "chmod 666 filename"
It seems that (quite reasonably) the file the app/app server creates has the persmissions of the app server 'owner' - root.
I wouldn't run any server as "root", but instead create a special account for it that is not a super-user.
Can't call method exec on class com.waveset.util.Util
==> java.security.AccessControlException: access denied (java.io.FilePermission /usr/bin/chmod execute)
Most Java servers use SecurityManagers to give (or deny) code certain permissions. The code you're running apparently does not have permission to execute system commands, which -as a default setup- sounds reasonable. But SecurityManagers are highly configurable (the relevant phrase to search for is "security policy") - the app server admin should be able to finetune it according to the application's need. Have a read of the server's documentation -the exact process is different for each server-, and then talk to the server admin about that.
subject: What must I add to the server.policy file to execute the shell program /usr/bin/chmod ?