My Oracle Support Banner

UTL_DBWS Reports "ORA-65040: operation not allowed from within a pluggable database" On DB 12.1.0.2.0 (Doc ID 2137245.1)

Last updated on APRIL 06, 2018

Applies to:

Web Services - Version 10.1.3.1.0 to 10.1.3.1.0 [Release Oracle10g]
Information in this document applies to any platform.

Symptoms

While trying to load utl_dbws package into 12c pluggable database, the following error is encountered:

arguments: '-u' 'john/john@orcl12' '-thin' '-r' '-v' '-f' '-genmissing' '-s' '-grant' 'public' 'dbwsclientws.jar' 'dbwsclientdb11.jar'
creating : resource META-INF/MANIFEST.MF
loading : resource META-INF/MANIFEST.MF
creating : resource META-INF/services/javax.xml.parsers.DocumentBuilderFactory
loading : resource META-INF/services/javax.xml.parsers.DocumentBuilderFactory

granting : execute on class HTTPClient/ntlm/NtlmSupportFlags$Flags to public
skipping : class HTTPClient/ntlm/NtlmSupportFlags$Flags
synonym : HTTPClient/ntlm/NtlmSupportFlags$Flags
Error while creating public synonym for HTTPClient/ntlm/NtlmSupportFlags$Flags
  ORA-65040: operation not allowed from within a pluggable database

granting : execute on class HTTPClient/ntlm/NtlmSupportFlags to public
skipping : class HTTPClient/ntlm/NtlmSupportFlags
synonym : HTTPClient/ntlm/NtlmSupportFlags
Error while creating public synonym for HTTPClient/ntlm/NtlmSupportFlags
  ORA-65040: operation not allowed from within a pluggable database

granting : execute on class HTTPClient/ntlm/NtlmType2Message to public
skipping : class HTTPClient/ntlm/NtlmType2Message
synonym : HTTPClient/ntlm/NtlmType2Message
Error while creating public synonym for HTTPClient/ntlm/NtlmType2Message
  ORA-65040: operation not allowed from within a pluggable database

exiting : Failures occurred during processing

 

WHAT IS WORKING
In 11g the steps work fine which is not the case for 12c DB


STEPS

1. Connect to the DB
 

SQL> connect sys/welcome1@orcl12 as sysdba
  Connected.


2. Check for invalid objects:

SQL> SELECT owner, status, count(*) FROM DBA_OBJECTS WHERE OBJECT_TYPE='JAVA CLASS' GROUP BY owner, status;


OWNER
--------------------------------------------------------------------------------

STATUS COUNT(*)
------- ----------
ALERT
VALID 2

MDSYS
VALID 597

SYS
VALID 27971


OWNER
--------------------------------------------------------------------------------

STATUS COUNT(*)
------- ----------
ORDSYS
VALID 2490

SQL> alter system set SHARED_POOL_SIZE=150M scope=both;
SQL> alter system set JAVA_POOL_SIZE=96M scope=both;
SQL> show parameter SHARED_POOL_SIZE
SQL> show parameter JAVA_POOL_SIZE



3. Show the pluggable databases

SQL> sho pdbs

  CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
  2 PDB$SEED READ ONLY NO
  3 PDBORCL MOUNTED
SQL> select name from v$datafile


4. set the container for the Pluggable database

SQL> ALTER PLUGGABLE DATABASE ALL OPEN;


Pluggable database altered.

SQL> alter session set container=pdborcl;


5. Create the user that will have the utl_dbws package

SQL> create user test identified by test container=current;

SQL> grant create session to test;
SQL> grant connect, resource to test identified by test;
SQL> grant create public synonym to test;



6. Grant priv to the user "TEST"

execute dbms_java.grant_permission('TEST','SYS:java.util.PropertyPermission','http.proxySet','write');

execute dbms_java.grant_permission('TEST','SYS:java.util.PropertyPermission','http.proxyHost', 'write');

execute dbms_java.grant_permission('TEST','SYS:java.util.PropertyPermission','http.proxyPort', 'write');

execute dbms_java.grant_permission('TEST','SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar','');

execute dbms_java.grant_permission('TEST','SYS:java.lang.RuntimePermission','getClassLoader','');

execute dbms_java.grant_permission('TEST','SYS:java.lang.RuntimePermission','createClassLoader','');

execute dbms_java.grant_permission('TEST','SYS:java.net.SocketPermission','*','connect,resolve');

execute dbms_java.grant_permission('TEST','SYS:java.util.PropertyPermission','*','read,write');

execute dbms_java.grant_permission('TEST','SYS:java.lang.RuntimePermission','setFactory','');

execute dbms_java.grant_permission( 'TEST', 'SYS:java.lang.RuntimePermission', 'shutdownHooks','' );

execute dbms_java.grant_permission( 'TEST', 'SYS:java.util.logging.LoggingPermission', 'control','' );


7. Download the utl_dbws package from the following location:

http://download.oracle.com/technology/sample_code/tech/java/jsp/dbws-callout-utility-10131.zip


8. Extract it to get the files you will use

9. in SQLplus execute the following SQL scripts in the same session where you did the above

SQL> @C:\Users\mbousrar\Downloads\utldbws\sqlj\lib\utl_dbws_decl.sql
 Package created.
SQL> @C:\Users\mbousrar\Downloads\utldbws\sqlj\lib\utl_dbws_body.sql
 Package body created.


10. Create sysnonym

SQL> CREATE PUBLIC SYNONYM utl_dbws FOR sys.utl_dbws;
Synonym created.

11. Grant the following

SQL> GRANT EXECUTE ON sys.utl_dbws TO TEST;
Grant succeeded.

12. Set the environment to load the package to the database:
      in a separate prompt do the following:

set PATH=C:\OraclePrograms\DB121\product\12.1.0\dbhome_1\jdk\bin;C:\OraclePrograms\DB121\product\12.1.0\dbhome_1\BIN;%PATH%

set CLASSPATH=C:\OraclePrograms\DB121\product\12.1.0\dbhome_1\jdbc\lib\ojdbc6.jar

13. Attempt to load the DBWS Callout Utility:

cd C:\Users\mbousrar\Downloads\utldbws\sqlj\lib

loadjava -thin -u test/test@localhost:151:orcl12 -r -v -f -genmissing -s -grant public dbwsclientws.jar dbwsclientdb11.jar 1> loadjava.log 2>loadjava.err




Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.