oracle / nosql-java-sdk

SDK for Java for the Oracle NoSQL Database
https://www.oracle.com/database/nosql/
Universal Permissive License v1.0
24 stars 24 forks source link

Include bcutil-jdk18on.jar into the dependencies. #127

Closed jinzha closed 3 weeks ago

jinzha commented 1 month ago

When use Instance Principal Auth to run functional test(nosql-drvier 5.4.15), got java.lang.NoClassDefFoundError: org/bouncycastle/asn1/oiw/OIWObjectIdentifiers error, and the nosql-drvier 5.4.15 uses bouncy-castle 1.78. (see discussion in slack https://proddev-database.slack.com/archives/C9A0HCEMP/p1726487223705179?thread_ts=1726158296.764489&cid=C9A0HCEMP)

Bouncycastle has changed the packaging since 1.78, the org/bouncycastle/asn1/*.class are moved to bcutil-jdk18on.jar, so need include bcutil-jdk18on.jar into the dependencies of nosql driver.

In driver/pom.xml, all the dependencies of bcprov-jdk18on and bcpkix-jdk18on are explicitly excluded, and the bcutil-jdk18on is dependency for test scope only. The bcutil-jdk18on and bcprov-jdk18on are only dependencies of bcpkix-jdk18on, and no dependency for bcprov-jdk18on.

So to fix it, simply remove the dependency exclusions of bcpkix-jdk18on and bcprov-jdk18on, and also remove dependency of bcutil-jdk18on for test, then the bcutil-jdk18on will be included into dependencies.

jinzha commented 3 weeks ago

@gmfeinberg I can't find the place of your comments about "Does "18on" mean 1.8 on or something else?" but I got notification.

Yes, it is JDK 1.8.

Here is description of bcprov-jdk18on in https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on: The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.8 and up