Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Problem with java stored procedure and symbolic links
Oracle Version - 8.1.7.4
OS - AIX 5.2
I have a java stored procedure that uses log4j to write to a log file.
If I grant the user permission to write to a directory like this, the
grant is successful, but the actual attempt to write fails. In this
case /opt/oracle is a symbolic link to /data/oracle.
dbms_java.grant_permission('USER1','SYS:java.io.FilePermission','/opt/oracle/home/user1/*','write');
ls -l /opt
lrwxrwxrwx 1 root system 12 Feb 01 2005 oracle ->
/data/oracle
However, if I change the grant to the actual physical path
dbms_java.grant_permission('USER1','SYS:java.io.FilePermission','/data/oracle/home/user1/*','write');
the grant is successful and the write is successful. Has anyone seen this issue with symbolic links before? I'm not sure if it's an oracle issue or a java issue. Here's the error when trying to write to the directory referenced by the symbolic link -
log4j:WARN Please initialize the log4j system properly.
com.xxx.yyy: Error loading configuration Cause: the
Permission (java.io.FilePermission /opt/oracle/home/USER1/logFile2.log
write)
has not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(USER1|PolicyTableProxy(USER1))
at ....
Original cause:
java.security.AccessControlException: the Permission
(java.io.FilePermission
/opt/oracle/home/user1/logFile2.log write) has not been granted by
dbms_java.grant_permission to
SchemaProtectionDomain(USER1|PolicyTableProxy(USER1))
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:199
)
at
java.security.AccessController.checkPermission(AccessController.java:403)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at
oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java
:222)
at java.lang.SecurityManager.checkWrite(SecurityManager.java:946)
at
oracle.aurora.rdbms.SecurityManagerImpl.checkWrite(SecurityManagerImpl.java:144)
at java.io.FileOutputStream.<init>(FileOutputStream.java:96)
at org.apache.log4
Call completed.
Thanks in advance for any help.
Bruce Received on Fri Nov 11 2005 - 21:46:26 CST