1 2 Previous Next 19 Replies Latest reply on Apr 27, 2010 9:14 AM by 748063

    java.security.AccessControlException:access denied

    748063
      Hi,
      i am having oracle10g forms.i have created browse file dialog box using java bean. Java code itself its works fine.i could able to browse a file and open it.but when i am trying to call it from forms the following exception occured.
      java.security.AccessControlException:access denied(java.io.FilePermission C:\arul\temp\Photos read).

      i have installed jpi. so my java folder path is
      C:\Program Files\Java\jdk1.5.0_10

      i have put java jar file in forms java folder and under jdk ext directory.

      i was running the form locally using OC4j.

      i have changed the java policy file in the following location(bolded lines).
      C:\Program Files\Java\jdk1.5.0_10\jre\lib\security


      // Standard extensions get all permissions by default

      grant codeBase "file:${{java.ext.dirs}}/*" {
           permission java.security.AllPermission;


      };

      // default permissions granted to all domains

      grant {
           // Allows any thread to stop itself using the java.lang.Thread.stop()
           // method that takes no argument.
           // Note that this permission is granted by default only to remain
           // backwards compatible.
           // It is strongly recommended that you either remove this permission
           // from this policy file or further restrict it to code sources
           // that you specify, because Thread.stop() is potentially unsafe.
           // See "http://java.sun.com/notes" for more information.
           permission java.lang.RuntimePermission "stopThread";

           // allows anyone to listen on un-privileged ports
           permission java.net.SocketPermission "localhost:1024-", "listen";

           // "standard" properies that can be read by anyone

      **permission java.io.FilePermission "C:\\arul\\temp\\Photos\\*", "read,write";**
      **permission java.io.FilePermission "${user.home}${/}*", "read";**
           permission java.util.PropertyPermission "java.version", "read";
           permission java.util.PropertyPermission "java.vendor", "read";
           permission java.util.PropertyPermission "java.vendor.url", "read";
           permission java.util.PropertyPermission "java.class.version", "read";
           permission java.util.PropertyPermission "os.name", "read";
           permission java.util.PropertyPermission "os.version", "read";
           permission java.util.PropertyPermission "os.arch", "read";
           permission java.util.PropertyPermission "file.separator", "read";
           permission java.util.PropertyPermission "path.separator", "read";
           permission java.util.PropertyPermission "line.separator", "read";

           permission java.util.PropertyPermission "java.specification.version", "read";
           permission java.util.PropertyPermission "java.specification.vendor", "read";
           permission java.util.PropertyPermission "java.specification.name", "read";

           permission java.util.PropertyPermission "java.vm.specification.version", "read";
           permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
           permission java.util.PropertyPermission "java.vm.specification.name", "read";
           permission java.util.PropertyPermission "java.vm.version", "read";
           permission java.util.PropertyPermission "java.vm.vendor", "read";
           permission java.util.PropertyPermission "java.vm.name", "read";
      };

      Could any one help how i correct this issue?whether i need to change java policy file or any client policy file?

      Thanks
      Arulselvan
        1 2 Previous Next