Sigrid, April 15, 2021 - 3:35 pm UTC
Thank you Connor for answering my question. I have tried the suggested method in two different PDB's from different container databases.
Case 1
CDB1: jar file was not loaded first in the root container.
PDB1 on CDB1: the jarfile was loaded into the PDB1 using the suggested method with no errors. It works fine.
Case 2
CDB2: jar file was loaded first in the root container without errors. All Java Sources are valid there.
PDB2 on CDB2: brings the following error when I try to import the jar file there with the suggested method.
SQL> connect sys/xxx@pdb2 as sysdba
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 PDB2 READ WRITE NO
SQL> alter session set "_ORACLE_SCRIPT"=true;
SQL> call dbms_java.loadjava('-v -r -g PUBLIC /home/oracle/downloads/java/javax.mail.jar');
call dbms_java.loadjava('-v -r -g PUBLIC /home/oracle/downloads/java/javax.mail.jar')
*
Error at Line 1:
ORA-00604: error occurred at recursive sql level 1
ORA-04020: deadlock detected while trying to lock object
SYS.javax/mail/internet/InternetHeaders$InternetHeader
How can I solve the problem for PDB2?
April 19, 2021 - 5:33 am UTC
That sounds like some sort of name clash, but you shouldn't be seeing 4020.
I think its time you need to get in touch with Support to potentially raise a bug.
Sigrid, April 19, 2021 - 8:34 am UTC
Thanks for the feedback. I have since run the call again with the -force option. This was executed without error message.
However, I had the problem that various public synonyms for the java sources were not created. I have now corrected this manually, so that it works at the moment.
June 01, 2021 - 1:47 am UTC
Nice work. Thanks for getting back to us