Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

loadjava load multiple dependent jar files

Aj09Oct 3 2020 — edited Oct 4 2020

Platform: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 (A pleasure to have moved to Oracle 19c)
Hello Experts, As always, my admiration for your time and expertise. After hours of exhaustive exploration and Oracle Docs and support pages we were unable to solve this issue.
Utility: loadjava
Action: Trying to load a .jar file using loadjava and call Java Class using PL/SQL Api. This java class simply adds a value to JMS queue and return a String with status as SUCCESS. Note: Hello.java worked successfully.
Issue: after a successful load using loadjava, When we execute via Oracle PL/SQL Function, we are getting the following error. "ORA-29532: Java call terminated by uncaught Java exception: javax.jms.JMSRuntimeException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory"
Our Trials: We thought it is missing some libraries of Weblogic. So we added wlthint3client.jar separately using loadjava utility. We also tried add wlthint3client.jar under "ORACLEHOME\jdk\jre\lib\ext" so that it gets picked up at instance load. But the error keeps happening. We included this as a part of our original jar yet same issue.
We went back to basics, and created both a Hello.java and Hello.class and loaded them using loadjava. With PL/SQL function called this class, and it worked successfully. Only when we load a .jar file it throws this ContextFactory error.
STEPS 1: under ORACLEHOME command prompt: loadjava -user userschema/password@instance -verbose -force JMessenger-1.0.jar.
It loaded successfully. Following is the output:
Classes Loaded: 97
Resources Loaded: 13
Sources Loaded: 0
Published Interfaces: 0
Classes generated: 0
Classes skipped: 0
Synonyms Created: 0
Errors: 0
STEPS 2 : Created an PL/SQL function:
CREATE OR REPLACE FUNCTION FUN_CALL_JAVA_TST RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'xyz.abc.messenger.producer.MessageProducer.testPing() return java.lang.String';
/
Step 3: We wrote a caller:
declare testoutput varchar2(100);
begin testoutput := FUN_CALL_JAVA_TST();
dbms_output.put_line(testoutput);
exception when others then
dbms_output.put_line(sqlerrm);
end;
Same error keeps coming.
Java Version in OracleHome installation: java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode).

So we made sure to use the correct weblogic version libraries.
Kindly suggest what we are missing.
Sincerely, Aj

Comments
Post Details
Added on Oct 3 2020
1 comment
802 views