2

Password4j 1.8.2 cannot be loaded under Oracle 23ai free because most of the time ora-29532 java call terminated by uncaught java exception java.lang.noclassdeffounderror org/slf4j/loggerfactory happens. It loads just fine under 19c via loadjava -v -thin -user

To Reproduce
Try to load slf4j-api and then password4j 1.8.2 into Oracle database via

loadjava -r -v -f -s -g "$SCHEMA_NAME" -resolve -user "$SCHEMA_NAME/$SCHEMA_PASSWORD@$CONTAINER_NAME" "$jar_file" 
loadjava -r -v -f -s -g "$SCHEMA_NAME" -append-resolver "((* -))" -jarsasdbobjects -user "$SCHEMA_NAME/$SCHEMA_PASSWORD@$CONTAINER_NAME" "$jar_file"`  
loadjava -v -thin -user "$SCHEMA_NAME/$SCHEMA_PASSWORD@$CONTAINER_NAME" "$jar_file"

(The examples are from a shell script of mine)

You will most likely get

ora-29532 java call terminated by uncaught java exception java.lang.noclassdeffounderror org/slf4j/loggerfactory

when you try to run an Argon2 implementation from Password4j, even though slf4j-api is loaded. I did not experience any change by upgrading to 1.8.3, sadly. Maybe I do something not the way it meant to be. With the -v -thin -user flags it works under 19c.

Expected behavior
I expect to use Password4j library in my project after load.

Environment:

  • OS: Oracle Linux 8 in docker

  • DB: Oracle 23ai free

  • JDK version:

In the database:

SELECT dbms_java.get_ojvm_property(PROPSTRING=>'java.version') FROM dual  
11.0.27

On OL8:

java -version  
openjdk version "17.0.15" 2025-04-15 LTS  
OpenJDK Runtime Environment (Red_Hat-17.0.15.0.6-2.0.1) (build 17.0.15+6-LTS)  
OpenJDK 64-Bit Server VM (Red_Hat-17.0.15.0.6-2.0.1) (build 17.0.15+6-LTS, mixed mode, sharing)

Additional context
Most of the classes are loaded as org.slf4j///org/slf4j/... but they should be org/slf4j/...

For instance:

org.slf4j///org/slf4j/loggerfactory and org/slf4j/LoggerFactory`

I tried loading by hand:

arguments: '-user' 'SEMA@FREEPDB1' '-verbose' '-resolve' 'slf4j-api-2.0.17.jar'
creating : jar slf4j-api-2.0.17.jar (module org.slf4j)
loading : jar slf4j-api-2.0.17.jar
creating : resource META-INF/MANIFEST.MF (module org.slf4j)
loading : resource META-INF/MANIFEST.MF
creating : resource META-INF/LICENSE.txt (module org.slf4j)
loading : resource META-INF/LICENSE.txt
creating : class org/slf4j/ILoggerFactory (module org.slf4j)
loading : class org/slf4j/ILoggerFactory
creating : class org/slf4j/IMarkerFactory (module org.slf4j)
loading : class org/slf4j/IMarkerFactory
creating : class org/slf4j/Logger (module org.slf4j)
loading : class org/slf4j/Logger
creating : class org/slf4j/LoggerFactory (module org.slf4j)
loading : class org/slf4j/LoggerFactory
creating : class org/slf4j/LoggerFactoryFriend (module org.slf4j)
loading : class org/slf4j/LoggerFactoryFriend
creating : class org/slf4j/MDC$1 (module org.slf4j)
loading : class org/slf4j/MDC$1
creating : class org/slf4j/MDC$MDCCloseable (module org.slf4j)
loading : class org/slf4j/MDC$MDCCloseable
creating : class org/slf4j/MDC (module org.slf4j)
loading : class org/slf4j/MDC
creating : class org/slf4j/Marker (module org.slf4j)
loading : class org/slf4j/Marker
creating : class org/slf4j/MarkerFactory (module org.slf4j)
loading : class org/slf4j/MarkerFactory
creating : class org/slf4j/event/DefaultLoggingEvent (module org.slf4j)
loading : class org/slf4j/event/DefaultLoggingEvent
creating : class org/slf4j/event/EventConstants (module org.slf4j)
loading : class org/slf4j/event/EventConstants
creating : class org/slf4j/event/EventRecordingLogger (module org.slf4j)
loading : class org/slf4j/event/EventRecordingLogger
creating : class org/slf4j/event/KeyValuePair (module org.slf4j)
loading : class org/slf4j/event/KeyValuePair
creating : class org/slf4j/event/Level (module org.slf4j)
loading : class org/slf4j/event/Level
creating : class org/slf4j/event/LoggingEvent (module org.slf4j)
loading : class org/slf4j/event/LoggingEvent
creating : class org/slf4j/event/SubstituteLoggingEvent (module org.slf4j)
loading : class org/slf4j/event/SubstituteLoggingEvent
creating : class org/slf4j/helpers/AbstractLogger (module org.slf4j)
loading : class org/slf4j/helpers/AbstractLogger
creating : class org/slf4j/helpers/BasicMDCAdapter$1 (module org.slf4j)
loading : class org/slf4j/helpers/BasicMDCAdapter$1
creating : class org/slf4j/helpers/BasicMDCAdapter (module org.slf4j)
loading : class org/slf4j/helpers/BasicMDCAdapter
creating : class org/slf4j/helpers/BasicMarker (module org.slf4j)
loading : class org/slf4j/helpers/BasicMarker
creating : class org/slf4j/helpers/BasicMarkerFactory (module org.slf4j)
loading : class org/slf4j/helpers/BasicMarkerFactory
creating : class org/slf4j/helpers/CheckReturnValue (module org.slf4j)
loading : class org/slf4j/helpers/CheckReturnValue
creating : class org/slf4j/helpers/FormattingTuple (module org.slf4j)
loading : class org/slf4j/helpers/FormattingTuple
creating : class org/slf4j/helpers/LegacyAbstractLogger (module org.slf4j)
loading : class org/slf4j/helpers/LegacyAbstractLogger
creating : class org/slf4j/helpers/MarkerIgnoringBase (module org.slf4j)
loading : class org/slf4j/helpers/MarkerIgnoringBase
creating : class org/slf4j/helpers/MessageFormatter (module org.slf4j)
loading : class org/slf4j/helpers/MessageFormatter
creating : class org/slf4j/helpers/NOPLogger (module org.slf4j)
loading : class org/slf4j/helpers/NOPLogger
creating : class org/slf4j/helpers/NOPLoggerFactory (module org.slf4j)
loading : class org/slf4j/helpers/NOPLoggerFactory
creating : class org/slf4j/helpers/NOPMDCAdapter (module org.slf4j)
loading : class org/slf4j/helpers/NOPMDCAdapter
creating : class org/slf4j/helpers/NOP_FallbackServiceProvider (module org.slf4j)
loading : class org/slf4j/helpers/NOP_FallbackServiceProvider
creating : class org/slf4j/helpers/NamedLoggerBase (module org.slf4j)
loading : class org/slf4j/helpers/NamedLoggerBase
creating : class org/slf4j/helpers/NormalizedParameters (module org.slf4j)
loading : class org/slf4j/helpers/NormalizedParameters
creating : class org/slf4j/helpers/Reporter$Level (module org.slf4j)
loading : class org/slf4j/helpers/Reporter$Level
creating : class org/slf4j/helpers/Reporter$TargetChoice (module org.slf4j)
loading : class org/slf4j/helpers/Reporter$TargetChoice
creating : class org/slf4j/helpers/Reporter (module org.slf4j)
loading : class org/slf4j/helpers/Reporter
creating : class org/slf4j/helpers/Slf4jEnvUtil (module org.slf4j)
loading : class org/slf4j/helpers/Slf4jEnvUtil
creating : class org/slf4j/helpers/SubstituteLogger (module org.slf4j)
loading : class org/slf4j/helpers/SubstituteLogger
creating : class org/slf4j/helpers/SubstituteLoggerFactory (module org.slf4j)
loading : class org/slf4j/helpers/SubstituteLoggerFactory
creating : class org/slf4j/helpers/SubstituteServiceProvider (module org.slf4j)
loading : class org/slf4j/helpers/SubstituteServiceProvider
creating : class org/slf4j/helpers/ThreadLocalMapOfStacks (module org.slf4j)
loading : class org/slf4j/helpers/ThreadLocalMapOfStacks
creating : class org/slf4j/helpers/Util$1 (module org.slf4j)
loading : class org/slf4j/helpers/Util$1
creating : class org/slf4j/helpers/Util$ClassContextSecurityManager (module org.slf4j)
loading : class org/slf4j/helpers/Util$ClassContextSecurityManager
creating : class org/slf4j/helpers/Util (module org.slf4j)
loading : class org/slf4j/helpers/Util
creating : class org/slf4j/spi/CallerBoundaryAware (module org.slf4j)
loading : class org/slf4j/spi/CallerBoundaryAware
creating : class org/slf4j/spi/DefaultLoggingEventBuilder$1 (module org.slf4j)
loading : class org/slf4j/spi/DefaultLoggingEventBuilder$1
creating : class org/slf4j/spi/DefaultLoggingEventBuilder (module org.slf4j)
loading : class org/slf4j/spi/DefaultLoggingEventBuilder
creating : class org/slf4j/spi/LocationAwareLogger (module org.slf4j)
loading : class org/slf4j/spi/LocationAwareLogger
creating : class org/slf4j/spi/LoggerFactoryBinder (module org.slf4j)
loading : class org/slf4j/spi/LoggerFactoryBinder
creating : class org/slf4j/spi/LoggingEventAware (module org.slf4j)
loading : class org/slf4j/spi/LoggingEventAware
creating : class org/slf4j/spi/LoggingEventBuilder (module org.slf4j)
loading : class org/slf4j/spi/LoggingEventBuilder
creating : class org/slf4j/spi/MDCAdapter (module org.slf4j)
loading : class org/slf4j/spi/MDCAdapter
creating : class org/slf4j/spi/MarkerFactoryBinder (module org.slf4j)
loading : class org/slf4j/spi/MarkerFactoryBinder
creating : class org/slf4j/spi/NOPLoggingEventBuilder (module org.slf4j)
loading : class org/slf4j/spi/NOPLoggingEventBuilder
creating : class org/slf4j/spi/SLF4JServiceProvider (module org.slf4j)
loading : class org/slf4j/spi/SLF4JServiceProvider
creating : resource META-INF/maven/org.slf4j/slf4j-api/pom.xml (module org.slf4j)
loading : resource META-INF/maven/org.slf4j/slf4j-api/pom.xml
creating : resource META-INF/maven/org.slf4j/slf4j-api/pom.properties (module org.slf4j)
loading : resource META-INF/maven/org.slf4j/slf4j-api/pom.properties
creating : class module-info (module org.slf4j)
loading : class module-info
skipping : resource META-INF/MANIFEST.MF (module org.slf4j)
skipping : resource META-INF/LICENSE.txt (module org.slf4j)
resolving: class org/slf4j/ILoggerFactory (module org.slf4j)
skipping : class org/slf4j/IMarkerFactory (module org.slf4j)
skipping : class org/slf4j/Logger (module org.slf4j)
resolving: class org/slf4j/LoggerFactory (module org.slf4j)
resolving: class org/slf4j/LoggerFactoryFriend (module org.slf4j)
skipping : class org/slf4j/MDC$1 (module org.slf4j)
skipping : class org/slf4j/MDC$MDCCloseable (module org.slf4j)
skipping : class org/slf4j/MDC (module org.slf4j)
skipping : class org/slf4j/Marker (module org.slf4j)
resolving: class org/slf4j/MarkerFactory (module org.slf4j)
skipping : class org/slf4j/event/DefaultLoggingEvent (module org.slf4j)
skipping : class org/slf4j/event/EventConstants (module org.slf4j)
skipping : class org/slf4j/event/EventRecordingLogger (module org.slf4j)
skipping : class org/slf4j/event/KeyValuePair (module org.slf4j)
skipping : class org/slf4j/event/Level (module org.slf4j)
skipping : class org/slf4j/event/LoggingEvent (module org.slf4j)
skipping : class org/slf4j/event/SubstituteLoggingEvent (module org.slf4j)
skipping : class org/slf4j/helpers/AbstractLogger (module org.slf4j)
skipping : class org/slf4j/helpers/BasicMDCAdapter$1 (module org.slf4j)
skipping : class org/slf4j/helpers/BasicMDCAdapter (module org.slf4j)
skipping : class org/slf4j/helpers/BasicMarker (module org.slf4j)
skipping : class org/slf4j/helpers/BasicMarkerFactory (module org.slf4j)
resolving: class org/slf4j/helpers/CheckReturnValue (module org.slf4j)
skipping : class org/slf4j/helpers/FormattingTuple (module org.slf4j)
skipping : class org/slf4j/helpers/LegacyAbstractLogger (module org.slf4j)
resolving: class org/slf4j/helpers/MarkerIgnoringBase (module org.slf4j)
skipping : class org/slf4j/helpers/MessageFormatter (module org.slf4j)
skipping : class org/slf4j/helpers/NOPLogger (module org.slf4j)
skipping : class org/slf4j/helpers/NOPLoggerFactory (module org.slf4j)
skipping : class org/slf4j/helpers/NOPMDCAdapter (module org.slf4j)
skipping : class org/slf4j/helpers/NOP_FallbackServiceProvider (module org.slf4j)
skipping : class org/slf4j/helpers/NamedLoggerBase (module org.slf4j)
skipping : class org/slf4j/helpers/NormalizedParameters (module org.slf4j)
skipping : class org/slf4j/helpers/Reporter$Level (module org.slf4j)
skipping : class org/slf4j/helpers/Reporter$TargetChoice (module org.slf4j)
skipping : class org/slf4j/helpers/Reporter (module org.slf4j)
resolving: class org/slf4j/helpers/Slf4jEnvUtil (module org.slf4j)
skipping : class org/slf4j/helpers/SubstituteLogger (module org.slf4j)
skipping : class org/slf4j/helpers/SubstituteLoggerFactory (module org.slf4j)
skipping : class org/slf4j/helpers/SubstituteServiceProvider (module org.slf4j)
skipping : class org/slf4j/helpers/ThreadLocalMapOfStacks (module org.slf4j)
skipping : class org/slf4j/helpers/Util$1 (module org.slf4j)
skipping : class org/slf4j/helpers/Util$ClassContextSecurityManager (module org.slf4j)
skipping : class org/slf4j/helpers/Util (module org.slf4j)
skipping : class org/slf4j/spi/CallerBoundaryAware (module org.slf4j)
skipping : class org/slf4j/spi/DefaultLoggingEventBuilder$1 (module org.slf4j)
skipping : class org/slf4j/spi/DefaultLoggingEventBuilder (module org.slf4j)
skipping : class org/slf4j/spi/LocationAwareLogger (module org.slf4j)
resolving: class org/slf4j/spi/LoggerFactoryBinder (module org.slf4j)
skipping : class org/slf4j/spi/LoggingEventAware (module org.slf4j)
skipping : class org/slf4j/spi/LoggingEventBuilder (module org.slf4j)
skipping : class org/slf4j/spi/MDCAdapter (module org.slf4j)
resolving: class org/slf4j/spi/MarkerFactoryBinder (module org.slf4j)
skipping : class org/slf4j/spi/NOPLoggingEventBuilder (module org.slf4j)
skipping : class org/slf4j/spi/SLF4JServiceProvider (module org.slf4j)
skipping : resource META-INF/maven/org.slf4j/slf4j-api/pom.xml (module org.slf4j)
skipping : resource META-INF/maven/org.slf4j/slf4j-api/pom.properties (module org.slf4j)
skipping : class module-info (module org.slf4j)
Classes Loaded: 56
Resources Loaded: 4
Sources Loaded: 0
Jars Loaded: 1
Published Interfaces: 0
Classes generated: 0
Classes skipped: 0
Synonyms Created: 0
Errors: 0

bash-4.4$ loadjava -user SEMA@FREEPDB1 -verbose -resolve password4j-1.8.2.jar

Password:
**************
arguments: '-user' 'SEMA@FREEPDB1' '-verbose' '-resolve' 'password4j-1.8.2.jar'
creating : resource META-INF/MANIFEST.MF
loading : resource META-INF/MANIFEST.MF
creating : class com/password4j/MessageDigestFunction
loading : class com/password4j/MessageDigestFunction
creating : class com/password4j/PropertyReader
loading : class com/password4j/PropertyReader
creating : class com/password4j/HashChecker
loading : class com/password4j/HashChecker
creating : class com/password4j/HashUpdate
loading : class com/password4j/HashUpdate
creating : class com/password4j/Utils$1
loading : class com/password4j/Utils$1
creating : class com/password4j/AbstractHashingFunction
loading : class com/password4j/AbstractHashingFunction
creating : class com/password4j/SystemChecker
loading : class com/password4j/SystemChecker
creating : class com/password4j/BenchmarkResult
loading : class com/password4j/BenchmarkResult
creating : class com/password4j/BcryptFunction
loading : class com/password4j/BcryptFunction
creating : class com/password4j/Password
loading : class com/password4j/Password
creating : class com/password4j/Hash
loading : class com/password4j/Hash
creating : class com/password4j/Argon2Function
loading : class com/password4j/Argon2Function
creating : class com/password4j/HashUpdater
loading : class com/password4j/HashUpdater
creating : class com/password4j/PepperGenerator
loading : class com/password4j/PepperGenerator
creating : class com/password4j/Utils
loading : class com/password4j/Utils
creating : class com/password4j/types/Argon2
loading : class com/password4j/types/Argon2
creating : class com/password4j/types/Bcrypt
loading : class com/password4j/types/Bcrypt
creating : class com/password4j/types/Hmac
loading : class com/password4j/types/Hmac
creating : class com/password4j/ScryptFunction
loading : class com/password4j/ScryptFunction
creating : class com/password4j/HashingFunction
loading : class com/password4j/HashingFunction
creating : class com/password4j/AlgorithmFinder$Param
loading : class com/password4j/AlgorithmFinder$Param
creating : class com/password4j/SecureString
loading : class com/password4j/SecureString
creating : class com/password4j/HashBuilder
loading : class com/password4j/HashBuilder
creating : class com/password4j/BadParametersException
loading : class com/password4j/BadParametersException
creating : class com/password4j/SaltOption
loading : class com/password4j/SaltOption
creating : class com/password4j/SaltGenerator
loading : class com/password4j/SaltGenerator
creating : class com/password4j/BalloonHashingFunction
loading : class com/password4j/BalloonHashingFunction
creating : class com/password4j/AlgorithmFinder
loading : class com/password4j/AlgorithmFinder
creating : class com/password4j/Blake2b
loading : class com/password4j/Blake2b
creating : class com/password4j/PBKDF2Function
loading : class com/password4j/PBKDF2Function
creating : class com/password4j/CompressedPBKDF2Function
loading : class com/password4j/CompressedPBKDF2Function
creating : resource META-INF/maven/com.password4j/password4j/pom.xml
loading : resource META-INF/maven/com.password4j/password4j/pom.xml
creating : resource META-INF/maven/com.password4j/password4j/pom.properties
loading : resource META-INF/maven/com.password4j/password4j/pom.properties
skipping : resource META-INF/MANIFEST.MF
resolving: class com/password4j/MessageDigestFunction
errors : class com/password4j/MessageDigestFunction
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
errors : class com/password4j/PropertyReader
ORA-29521: referenced name org/slf4j/Logger could not be found
ORA-29521: referenced name org/slf4j/LoggerFactory could not be found
resolving: class com/password4j/HashChecker
errors : class com/password4j/HashChecker
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
errors : class com/password4j/HashUpdate
ORA-29534: referenced object SEMA.com/password4j/Hash could not be resolved
errors : class com/password4j/Utils$1
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
errors : class com/password4j/AbstractHashingFunction
ORA-29534: referenced object SEMA.com/password4j/HashingFunction could not be resolved
ORA-29534: referenced object SEMA.com/password4j/Hash could not be resolved
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
ORA-29534: referenced object SEMA.com/password4j/Hash could not be resolved
resolving: class com/password4j/SystemChecker
errors : class com/password4j/SystemChecker
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
errors : class com/password4j/BenchmarkResult
ORA-29534: referenced object SEMA.com/password4j/AbstractHashingFunction could not be resolved
errors : class com/password4j/BcryptFunction
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
resolving: class com/password4j/Password
errors : class com/password4j/Password
ORA-29534: referenced object SEMA.com/password4j/HashBuilder could not be resolved
errors : class com/password4j/Hash
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
errors : class com/password4j/Argon2Function
ORA-29534: referenced object SEMA.com/password4j/SaltGenerator could not be resolved
errors : class com/password4j/HashUpdater
ORA-29534: referenced object SEMA.com/password4j/HashChecker could not be resolved
errors : class com/password4j/PepperGenerator
ORA-29534: referenced object SEMA.com/password4j/PropertyReader could not be resolved
errors : class com/password4j/Utils
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
ORA-29534: referenced object SEMA.com/password4j/PropertyReader could not be resolved
skipping : class com/password4j/types/Argon2
skipping : class com/password4j/types/Bcrypt
skipping : class com/password4j/types/Hmac
errors : class com/password4j/ScryptFunction
ORA-29534: referenced object SEMA.com/password4j/SaltGenerator could not be resolved
errors : class com/password4j/HashingFunction
ORA-29534: referenced object SEMA.com/password4j/Hash could not be resolved
errors : class com/password4j/AlgorithmFinder$Param
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
skipping : class com/password4j/SecureString
errors : class com/password4j/HashBuilder
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
skipping : class com/password4j/BadParametersException
skipping : class com/password4j/SaltOption
errors : class com/password4j/SaltGenerator
ORA-29534: referenced object SEMA.com/password4j/AlgorithmFinder could not be resolved
errors : class com/password4j/BalloonHashingFunction
ORA-29534: referenced object SEMA.com/password4j/HashingFunction could not be resolved
errors : class com/password4j/AlgorithmFinder
ORA-29521: referenced name org/slf4j/Logger could not be found
ORA-29521: referenced name org/slf4j/LoggerFactory could not be found
errors : class com/password4j/Blake2b
ORA-29534: referenced object SEMA.com/password4j/Utils could not be resolved
errors : class com/password4j/PBKDF2Function
ORA-29534: referenced object SEMA.com/password4j/SaltGenerator could not be resolved
errors : class com/password4j/CompressedPBKDF2Function
ORA-29534: referenced object SEMA.com/password4j/PBKDF2Function could not be resolved
skipping : resource META-INF/maven/com.password4j/password4j/pom.xml
skipping : resource META-INF/maven/com.password4j/password4j/pom.properties
The following operations failed
class com/password4j/MessageDigestFunction: resolution
class com/password4j/PropertyReader: resolution
class com/password4j/HashChecker: resolution
class com/password4j/HashUpdate: resolution
class com/password4j/Utils$1: resolution
class com/password4j/AbstractHashingFunction: resolution
class com/password4j/SystemChecker: resolution
class com/password4j/BenchmarkResult: resolution
class com/password4j/BcryptFunction: resolution
class com/password4j/Password: resolution
class com/password4j/Hash: resolution
class com/password4j/Argon2Function: resolution
class com/password4j/HashUpdater: resolution
class com/password4j/PepperGenerator: resolution
class com/password4j/Utils: resolution
class com/password4j/ScryptFunction: resolution
class com/password4j/HashingFunction: resolution
class com/password4j/AlgorithmFinder$Param: resolution
class com/password4j/HashBuilder: resolution
class com/password4j/SaltGenerator: resolution
class com/password4j/BalloonHashingFunction: resolution
class com/password4j/AlgorithmFinder: resolution
class com/password4j/Blake2b: resolution
class com/password4j/PBKDF2Function: resolution
class com/password4j/CompressedPBKDF2Function: resolution

In my standalone java project it works with JDK 8/11 and even with the newer ones.

Please help! :)

If you need anyhing to uncover this, I will gladly help. Thanks! :)

2
  • 1
    It is hard to read the question because of the excessive use of inline code spans for formatting. Use code block format instead for full lines or multiline code, errors or logs, including the commands and their outputs. Commented Jun 7 at 15:06
  • @aled I hope now it is satisfactory :) Commented Jun 7 at 20:23

1 Answer 1

1
+150

The issue lies in how this Oracle JVM handles modular JAR files, it's changed in Oracle 23ai from 19c.

The root cause: JPMS module-info in Oracle 23ai OJVM

The primary reason you're encountering java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory in Oracle 23ai but not in 19c, is the Java Platform Module System.

  1. SLF4J 2.x is Modular: The slf4j-api-2.x.x.jar you're using is a modular JAR. It contains a module-info.class file that declares it as Java module org.slf4j. Your loadjava output confirms this: creating : jar slf4j-api-2.0.17.jar (module org.slf4j).

  2. Oracle 23ai OJVM is Module-Aware: The OJVM in Oracle 23ai is based on JDK 11, which fully supports JPMS. When loadjava processes this modular JAR, it appears to be creating the Java objects in the database with a name that includes the module leading to the strange pathing you observed (org.slf4j///org/slf4j/...). This effectively makes the class org.slf4j.LoggerFactory undiscoverable by its standard name.

  3. Oracle 19c OJVM is Not Module-Aware: The OJVM in Oracle 19c is based on JDK 8 which predates JPMS. It simply ignores the module-info.class file and loads all the classes from the JAR onto the standard "classpath" within the database which is why it works without issue.

When password4j.jar is loaded and resolved its code looks for the class org/slf4j/LoggerFactory. In the 23ai database this object doesn't exist under that exact name due to the module pathing issue, hence the NoClassDefFoundError and the subsequent ORA-29532.

Potential solution: use non-modular slf4j API and add binding

You need to provide the OJVM with JARs it can handle correctly.

  1. Use a version of slf4j-api that is not a JPMS module.

  2. Provide an actual SLF4J binding. The slf4j-api.jar is only an interface without a logging implementation (a "binding"), the LoggerFactory can sometimes fail to initialize properly. For a database environment the NOP binding is the safest choice.

1. Download correct JARs

For maximum compatibility with the Oracle OJVM environment, you need use the latest stable version of the SLF4J 1.7.x series. This series predates the widespread use of JPMS modules and is guaranteed to work. Password4j is fully compatible with it.

  1. SLF4J API (Non-Modular): Download slf4j-api-1.7.36.jar.

  2. SLF4J binding (No-Operation): Download slf4j-nop-1.7.36.jar. This's a no-operation logger that satisfies the API's need for a binding but does nothing which is perfect for an embedded database environment where you don't want logs going to standard out.

  3. Password4j: Keep your password4j-1.8.2.jar or 1.8.3.jar.

2. Clean up database schema

Before loading the new JARs, it's critical to remove any previously loaded potentially corrupted Java objects from your schema.

Use the dropjava utility for each JAR you attempted to load.

Define your connection details:

SCHEMA_NAME="SEMA"
SCHEMA_PASSWORD="your_password_here" # <-- IMPORTANT: Use your actual password
CONTAINER_NAME="FREEPDB1"
CONNECTION_STRING="$SCHEMA_NAME/$SCHEMA_PASSWORD@$CONTAINER_NAME"
echo "--- Cleaning up previous Java objects ---"
dropjava -v -user "$CONNECTION_STRING" slf4j-api-2.0.17.jar
dropjava -v -user "$CONNECTION_STRING" password4j-1.8.2.jar

if a previous load failed dropjava may report here that some objects don't exist.

3. Load the JARs in correct order

Dependency order matters. You must load the API, then the binding and finally the library that uses them. You need use a simple and effective loadjava command. Assumes the JARs are in your current directory:

SLF4J_API_JAR="slf4j-api-1.7.36.jar"
SLF4J_NOP_JAR="slf4j-nop-1.7.36.jar"
PASSWORD4J_JAR="password4j-1.8.2.jar"
echo "--- Loading SLF4J API (v1.7.36) ---"
loadjava -r -v -f -user "$CONNECTION_STRING" "$SLF4J_API_JAR"
echo "--- Loading SLF4J NOP Binding (v1.7.36) ---"
loadjava -r -v -f -user "$CONNECTION_STRING" "$SLF4J_NOP_JAR"
echo "--- Loading Password4j ---"
loadjava -r -v -f -user "$CONNECTION_STRING" "$PASSWORD4J_JAR"

Where:

  • -r or -resolve: This's the most critical flag. It compiles the source and resolves all class references within the database after loading. This ensures password4j can find the slf4j classes

  • -v or -verbose: Shows detailed progress which is good for troubleshooting

  • -f or -force: Forces the loading of JAR files even if they have been loaded before. This's useful when re-loading after a dropjava

  • -user: Specifies the database schema and connection

The other flags you tried (-thin, -s, -g, -jarsasdbobjects) are not necessary for solving this specific resolution problem and are best omitted to keep the command simple.

4. Verify the installation

After running the loadjava commands all classes should be loaded and valid. You need verify this with a simple SQL query.

SELECT object_name, object_type, status FROM user_objects WHERE object_type = 'JAVA CLASS' AND status = 'INVALID';

Expected result: no rows selected

If you get any invalid Java classes, especially from password4j, it means a reference could still not be resolved. But the sequence above should prevent this.

With these steps your password4j library should be correctly loaded, resolved against a compatible SLF4J implementation and ready to be used in your PL/SQL wrappers or other Java stored procedures in Oracle 23ai.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.