Home » SQL & PL/SQL » SQL & PL/SQL » File/Folder write permission in Oracle via Java Policy (Oracle 11g)
File/Folder write permission in Oracle via Java Policy [message #609938] Fri, 14 March 2014 06:01 Go to next message
didiera123
Messages: 2
Registered: October 2013
Junior Member
Dear All,

I wish to have your views on a file/folder permission I encountered in Oracle.

The Scenario :

I have defined a Java class in oracle to probe a folder for files to be loaded via SQL Loader.
The Java class is to create an SQL Loader control file (EMS_ECOMGEN4.ctl) on the fly based on the number of input files available.
There is a specific target directory where source files and control file are to reside and same has been created ('/universe/ecomgen4spool/in/deposit).
I have already granted permission to the oracle user through which the Java class function is invoked.
Permission grnated through dbms_java.grant_permission and at OS level too.

The problem:

I keep on getting error:
ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.io.FilePermission /universe/ecomgen4spool/in/deposit/EMS_ECOMGEN4.ctl' write) has not been granted to EMS. The PL/SQL to grant this is dbms_java.grant_permission( 'EMS', 'SYS:java.io.FilePermission', '/universe/ecomgen4spool/in/deposit/EMS_ECOMGEN4.ctl'', 'write' )


Steps already tested unsuccessfully :

1] Granting permission folder-wide
dbms_java.grant_permission( 'EMS', 'SYS:java.io.FilePermission', '/universe/ecomgen4spool/in/deposit/*'', 'write' )

2] Placing dummy control file prior to granting permission on same in target folder.


Please suggest any workarounds/explanations for this issue.
I have enclosed a snapshot of the grnats allocated to user EMS

Regards,
Didier

Re: File/Folder write permission in Oracle via Java Policy [message #609961 is a reply to message #609938] Fri, 14 March 2014 12:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Did you try the statement given in the error message?

Re: File/Folder write permission in Oracle via Java Policy [message #610032 is a reply to message #609961] Mon, 17 March 2014 00:36 Go to previous message
didiera123
Messages: 2
Registered: October 2013
Junior Member
Dear Michel,

I did and the snapshot enclosed in my previous post shows it but it's still not working.
Previous Topic: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
Next Topic: AutoCommit in Stored Proc
Goto Forum:
  


Current Time: Fri Apr 19 22:17:31 CDT 2024