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 -> Re: Java SP writing to file system

Re: Java SP writing to file system

From: Ban Spam <ban-spam_at_operamail.com>
Date: Sat, 19 Jan 2002 20:13:16 GMT
Message-ID: <Xns919B7C51D2321SunnySD@24.0.3.73>


tarik_sadat_at_amat.com (Tarik) wrote in
news:b4f9d801.0201180904.74e73d05_at_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
>

I suspect the problem is one of permissions. AFAIK when using UTL_FILE the file is ALWAYS owned by user "oracle". Does user oracle, really, really have write permission in this folder? Is there an existing file of the same name owned by a different user? Does user oracle have delete privs on this file?

The problem REALLY is an OS issue & not an Oracle problem.

HTH & YMMV HAND! Received on Sat Jan 19 2002 - 14:13:16 CST

Original text of this message

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