DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: !

  1. #1
    Join Date
    Aug 2005
    Posts
    3

    !

    Hello,
    Thanks in advance for helping. Here is the problem...

    I'm testing a Java proc that I will be calling in a trigger. This proc works when run from a command line outside of oracle.


    In the PBRELIN schema I run:

    exec :x := pbrelin.createRemedyTicket('WE','S0400', '111', 'WE', 'A0400', '112', 'Bob Jones', 'Boss');

    I get...

    *
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission java.lib.path write) has not been granted to PBRELIN. The PL/SQL to grant this is dbms_java.grant_permission( 'PBRELIN',
    'SYS:java.util.PropertyPermission', 'java.lib.path', 'write' )
    ORA-06512: at "PBRELIN.CREATEREMEDYTICKET", line 0
    ORA-06512: at line 1

    So in the PBRELIN schema I run
    exec dbms_java.grant_permission('PBRELIN', 'SYS:java.util.PropertyPermission', 'java.lib.path', 'write' );

    PL/SQL procedure successfully completed.

    I run the createRemedyTicket java proc again and I get the same error.

    So, I connect to SYS/xxxx as sysdba and run

    exec dbms_java.grant_permission('SYS', 'SYS:java.lang.RuntimePermission', 'loadLibrary.arjni60', 'read ,write, execute, delete' );

    AND

    call dbms_java.grant_policy_permission('PBRELIN','SYS','java.io.FilePermission','*');

    connect back to PBRELIN

    I run the createRemedyTicket java proc again and I get the same error.

    I've checked my class paths, they seem ok.

    Any ideas what I might be doing wrong?

    Thanks

  2. #2
    Join Date
    Dec 2000
    Posts
    138
    If you are java procedure contains only database related commands then consider writing a PL/SQL procedure which is the right way to do.

    If its not tell us what the java procedure does
    -dharma

  3. #3
    Join Date
    Aug 2005
    Posts
    3
    Dharma,
    The PL/SQL trigger passes the createRemedyTicket java proc data to create a help desk ticket in a system called REMEDY. REMEDY has java APIs that the createRemedyTicket java proc calls to do this.

  4. #4
    Join Date
    Aug 2005
    Posts
    3

    Here's the problem,

    Utilizing Java Native Interface (JNI) Support

    The Java Native Interface (JNI) is a standard programming interface for writing Java native methods and embedding the Java virtual machine into native applications. The primary goal of JNI is to provide binary compatibility of Java applications that use platform-specific native libraries.

    Oracle does not support the use of JNI in Oracle9i Java applications. If you use JNI, your application is not 100% pure Java, and the native methods require porting between platforms. Native methods have the potential for crashing the server, violating security, and corrupting data.



    Oh well, back to the old drawing board

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Did you grant explicit permission (not through a role) to the object? Seems like a permission issue to me, although I'm not well versed in java...
    Jeff Hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width