I have successfully set up a JBoss staging server to be run as a linux service (Debian distribution and more specifically A Linux Mint 15).
When I run the service (not with root profile = no `sudo`):
every thing works fine except for a module where I used to create a file to write in some report stuff and seems like the file creation is denied because of permission limitations.
My sources for the code where I create a new `File` are as follows:
It is quite clear that my issue is risen due to use of the AccessController but lets say that this is a security restriction and a I need to have work as is.
What I tried to bypass this Security restriction
* I have set the *jboss-user* to be owner of the jboss service script:
* After some debugging sessions, I realized that initially the reportFile was created under the root folder ("/"), so I managed to initialize the user.dir system property and set it up to a directory path (/report) under jboss-user home directory (to make sure the user have read/write permissions):
* I have added a SecurityManager and declared a security policy file:
The /home/jboss-user/.java.policy has below content, (all permissions are granted):
* Checked that "home/jboss-user/report" directory where my file is supposed to go in has read/write permissions set to all users.
After applying all above tricks, I still cannot have my file created and I still stack with a:
I have also tried to play with directory permissions, jboss service script owner, the java policy rules but none of there has made the line.
One more addendum that I should point id that there is no issue when running the JBoss AS basically from the start script and I can have my file successfully created.
Many thanks @Jaikiran Pai
Here is the full trace of the thrown exception, noting that I update my code to catch an Exception instance instead of PrivilegedActionException since the later does not let get the whole cause:
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
ScroogeXHTML - small and flexible RTF to HTML converter library