Skip to content
Advertisement

How to correctly develop, upload java library with dependencies to Oracle DB and call my Java function from PLSQL?

I have:

  1. Oracle 19c
  2. java 8 on its machine

What i did:

I write simple class with one method in Java 8.

JavaScript

I compile my project with maven and maven-assembly-plugin to build .jar file with dependencies.

I upload it with loadtool: loadjava -f -r -v -synonym -oracleresolver -resolve -grant <user> -thin -user <credentials> <filename>.jar

There were 0 errors during upload. All uploaded classes (including dependencies) have ‘VALID’ status in dba_objects table.

I write PL/SQL wrapper over my Java function.

JavaScript

I use this function in my ORDS REST Service.

When doing request to ORDS i am getting this exception:

JavaScript

Quiestion is:

What is root of this problem? By -synonym flag tool creates synonyms for me, all classes is valid. Do i need some permisions to use java packages liike java.sql that in my class imports? I upload some others open sources java libraries into my Oracle, but they doesn’t hava dependencies – is that the problem?

Advertisement

Answer

Problem was in slf4j library that throws this exception. slf4j was dependency of library that i used. Didn’t dig the problem, I just pick another labrary with less dependencies and its works.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement