Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Java SP writing to file system

Java SP writing to file system

From: Tarik <tarik_sadat_at_amat.com>
Date: 18 Jan 2002 09:04:19 -0800
Message-ID: <b4f9d801.0201180904.74e73d05@posting.google.com>


Hi

I've been browsing through the archives of this group, but it doesn't seem to want to let me post a reply to questions that have already been asked on this subject. So I'll start a new thread... Sorry!

Anyway, I've written a Java stored procedure that writes to a text file. Everything works fine when run standalone, but as soon as I try and run it as a Java Stored Procedure I get a file permission error:

ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.io.FilePermission
C:/TEMP/DropUserscats4tst.txt write) has not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(AIT|PolicyTableProxy(AIT)) ORA-06512: at "AIT.USER_CONTROL", line 38 ORA-06512: at line 1

Now I have previously logged on as the SYSTEM user and specifically granted read, write perimission to the user AIT like this:

SQL> exec dbms_java.grant_permission('AIT', 'java.io.FilePermission', 'C:/Temp/*', 'read, write')

PL/SQL procedure successfully completed.

SQL> but when I run the procedure as that user I still get the error.

Now you'll notice I'm running under NT, whilst the example in the book shows UNIX format. Could that have anything to do with it? I've tried entering the file path with backslashes and with forward slashes, and both appear to work successfully, yet with the same result. In the Java SP I can't of course use the Windows format for file paths, I have to use the UNIX format, but that works anyway when I run standalone.

Any pointers grateflly accepted!

Tarik Received on Fri Jan 18 2002 - 11:04:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US