Oct 10, 2018

ORA-29532 : Java call terminated by uncaught Java exception - fix

Regarding ORA-29532, Oracle support suggested some guide lines to fix the issue. These suggestions outline these error possibilities and resolutions by showing three examples. 

Perhaps one of these examples is similar to your problem with ORA-29532:

The Error:

Sometimes an application running in the Oracle JVM will fail with a java permissions error having the following format when application user tested one Pl/SQL block:

SQL> SET SERVEROUTPUT ON;
SQL> 
DECLARE
V_INFO VARCHAR2(4000):=NULL;
BEGIN
V_INFO:=PKG_VALIDATE.SHOW_STATUS('C_CUSTOMER','null');
DBMS_OUTPUT.PUT_LINE ('V_INFO value is '||V_INFO);
DBMS_OUTPUT.PUT_LINE ('Completed successfully...');
EXCEPTION WHEN OTHERS THEN  
DBMS_OUTPUT.PUT_LINE ('ERROR!!!'||SQLERRM);
END;
/
SQL>

anonymous block completed
ERROR ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.net.SocketPermission hostname:7001 

connect,resolve) has not been granted to CRM_CUSTOMER. The PL/SQL to grant this is dbms_java.grant_permission( 'CRM_CUSTOMER', 'SYS:java.net.SocketPermission', 'hostname:7001', 

'connect,resolve' )
...

Solution:

exec dbms_java.grant_permission('CRM_CUSTOMER','SYS:java.io.FilePermission', '/opt/crm/StoredProcLog.log', 'write');
EXEC DBMS_JAVA.GRANT_PERMISSION('CRM_CUSTOMER','SYS:java.net.SocketPermission', 'hostname:7001', 'connect,resolve' );
exec dbms_java.grant_permission('CRM_CUSTOMER','SYS:java.net.SocketPermission', 'hostname:7001', 'connect,resolve' );
exec dbms_java.grant_permission('CRM_CUSTOMER','SYS:javax.net.ssl.SSLPermission', 'setHostnameVerifier', '');
EXEC DBMS_JAVA.GRANT_PERMISSION('CRM_CUSTOMER','SYS:java.lang.RuntimePermission', 'setFactory', '' );
commit;


Note: Commit is mandatory !!

No comments:

Post a Comment

Translate >>