ORA-29532 When Granting java.lang.RuntimePermission To loadLibrary.oraawt (Doc ID 259471.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 8.1.7.4 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Jun-2017***


Symptoms

1) Running java stored procedure that references java.awt.* libraries produces the errors:

ORA-29532: Java call terminated by uncaught Java exception:
java.lang.UnsatisfiedLinkError: no oraawt in java.library.path

ORA-29532: Java call terminated by uncaught Java exception:
java.lang.NoClassDefFoundError



The generated trace file shows errors:

java.lang.UnsatisfiedLinkError: no oraawt in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java)
at java.lang.Runtime.loadLibrary0(Runtime.java)
at java.lang.System.loadLibrary(System.java)
at java.lang.System.loadLibrary(System.java)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java)
at java.security.AccessController.doPrivileged(AccessController.java)
at java.awt.Toolkit.loadLibraries(Toolkit.java:852)
at java.awt.Toolkit.(Toolkit.java:873)
at java.awt.Color.(Color.java:185)



The most likely reason for these errors is that the java.lang.RuntimePermission for "loadLibrary.oraawt" is missing from the java policy table, and therefore prevents 'java.awt.*' libraries being used by java stored procedures in the database.

2) To add the missing permission to the java policy table, run

SQL> connect / as sysdba
SQL> call dbms_java.grant_permission('SYS', 'java.lang.RuntimePermission', 'loadLibrary.oraawt', null);



However, this produces the errors:

ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException: policy table update
SYS:java.lang.RuntimePermission, loadLibrary.oraawt



The generated trace file shows errors:

java.lang.SecurityException: policy table update SYS:java.lang.
RuntimePermission, loadLibrary.oraawt
at oracle.aurora.rdbms.security.PolicyTable$Updater.insert(PolicyTable.java)
at oracle.aurora.rdbms.security.PolicyTableManager.add(PolicyTableManager.java)
at oracle.aurora.rdbms.security.PolicyTableManager.activate(PolicyTableManager.java)
at oracle.aurora.rdbms.security.PolicyTableManager.grant(PolicyTableManager.java)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms