0 Replies Latest reply: Sep 19, 2011 8:34 PM by Robb Salzmann RSS

    udf.policy - Unable to Grant Read,Write to Specific File

    Robb Salzmann
      Essbase 9.3.1
      Using a Java Custom Defined Function (CDF) that reads and writes to a file in an Essbase calc script.

      I'm trying to grant permission to a specific file in the file system by granting permission in the udf.policy file.

      When I uncomment the line permission java.security.AllPermission; the CDF works fine and interacts with the file correctly. This is just to prove that the CDF works, I need to tighten this up to a single file. I stop and start the app after each edit.(I've also tried bouncing the Essbase server too)

      When I use the following, I get an exception, shown below. Nothing of consequence is being written to the app or essbase logs
      grant {
        permission java.io.FilePermission "C:/test/essbase/CalcProfile.db", "write, read";
      };
      java.security.AccessControlException: access denied (java.io.FilePermission C:\esstest\Server\PlugIns\Essbase read)
           at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
           at java.security.AccessController.checkPermission(AccessController.java:546)
           at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
           at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
           at com.hyperion.essbase.calculator.ESecurityManager.checkRead(ESecurityManager.java:80)
           at java.io.File.exists(File.java:731)
           at org.sqlite.Conn.open(Conn.java:98)
           at org.sqlite.Conn.<init>(Conn.java:57)
           at org.sqlite.JDBC.createConnection(JDBC.java:77)
           at org.sqlite.JDBC.connect(JDBC.java:64)
           at java.sql.DriverManager.getConnection(DriverManager.java:582)
           at java.sql.DriverManager.getConnection(DriverManager.java:207)
           at com.accelatis.essbase.calcprofile.cdf.CalcComment.calcComment(CalcComment.java:16)
      >

      I've tried creating the policy using PolicyTool, same result. However, I have no idea what or if I should put in the "CodeBase" field.
      Has anyone had success creating read & write permissions to a single file using the udf.policy file? What is the magic syntax?

      Regards,
      Robb Salzmann