SecurityException when trying to export a java resource

Posted by thecoop on Stack Overflow See other posts from Stack Overflow or by thecoop
Published on 2010-03-19T12:35:11Z Indexed on 2010/03/20 5:51 UTC
Read the original article Hit count: 292

Filed under:
|
|
|

I'm trying to get the source of a java resource stored in an oracle database using this code (connecting as SYSTEM for testing):

DECLARE
    javalob CLOB;
BEGIN
    DBMS_LOB.CREATETEMPORARY(javalob, false);
    DBMS_JAVA.EXPORT_RESOURCE('RESOURCENAME', 'SCHEMA', javalob);
    DBMS_OUTPUT.PUT_LINE(javalob);
END;

But when I try to run it I get this:

Java call terminated by uncaught Java exception: java.lang.SecurityException: cannot read <Resource Handle: RESOURCENAME|SCHEMA|301> because SYSTEM does not have execute privilege on it

This thing is, I'm not sure how to grant permissions on <Resource Handle: RESOURCENAME|SCHEMA|301>, as this isn't a SQL or PL/SQL object. And why doesn't SYSTEM have access to it anyway?

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about java