Skip to content

Conversation

@jinzha
Copy link
Member

@jinzha jinzha commented Sep 16, 2024

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.

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 bouncycastle 1.78.

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 jinzha requested a review from connelly38 September 16, 2024 20:43
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 16, 2024
@jinzha
Copy link
Member Author

jinzha commented Sep 27, 2024

@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

@jinzha jinzha merged commit b3f5759 into main Sep 27, 2024
@gmfeinberg gmfeinberg deleted the fix/include_bcutil branch October 29, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants