Last weekend used some Java Procedures in the database to read and parse files. When granting the permissions (done by the dbms_java package)

EXEC DBMS_JAVA.GRANT_PERMISSION( 'testdeveloper', 'SYS:java.io.FilePermission','/mnt/myhome/tesfiles/', 'read' );

I got this error:

ORA-29532: Java call terminated by uncaught Java exception:
oracle.aurora.vm.IdNotFoundException: -1 is not the number of a user or role
ORA-06512: at "SYS.DBMS_JAVA", line 313
ORA-06512: at line 1

Solution for this: just write the schema name in uppercase!Smile

EXEC DBMS_JAVA.GRANT_PERMISSION('TESTDEVELOPER','SYS:java.io.FilePermission','/mnt/myhome/tesfiles/', 'read' )