[jboss-user] [Security & JAAS/JBoss] - Permission Denied when getting FileInputStream

sarinbabu do-not-reply at jboss.com
Sun Dec 16 03:13:53 EST 2007

Hi All,

I am getting a java.io.FileNotFoundException(Permission denied) exception when I am trying to open a FileInputStream to a file in my local directory that has permissions -rwxr--r--.

Our application actually allows to copy a file from any location in the unix file system to our application's "vault" in the same unix file system.

I am getting this error when trying to copy a file with the above permissions from my home directory to the vault location from GUI.  But I am able to successfully copy the same file from the my home directory to the same vault location using a test case(run using TestNG which basically uses JUnit).

Our application is deployed in JBoss and I am logging in as myself into our application.

I have seen the server.policy file in /jboss-4.0.2/server/default/conf/ which grants AllPermissions:

grant {
  |    // Allow everything for now
  |    permission java.security.AllPermission;
  | };

But I am still wondering why I am getting the (Permission denied) exception when I access our application from GUI while I am trying to open a FileInputStream to this file which has "read" access to all the users (in the backend code); suprisingly I don't get this error when I run the backend code from the TestNG test case !!!

I would really appreciate any help regarding what I am missing here.  I am not even sure whether it is JBoss's login-config.xml or server.policy that I need to change to get read access to the file I am accessing.

Please let me know.  This is difficult to debug for me and I am totally frustrated now.  I have been on this for the past 4 days, but could not resolve it.  Looking for help.

Our application uses, Spring 2.0, Hibernate 3.2 and AJAX backed by Oracle and deployed in JBoss 4.0.2.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113199#4113199

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113199

More information about the jboss-user mailing list