0

Seeing the following exception on running the "ObjectStorageSyncExample" from the SDK. I have not made any modifications. Configured the ~/.oci/config correctly as well.


Exception in thread "main" java.lang.NoSuchFieldError: id_ecPublicKey at org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.(Unknown Source) at com.oracle.bmc.http.signing.internal.PEMFileRSAPrivateKeySupplier.(PEMFileRSAPrivateKeySupplier.java:47) at com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory.createKeySupplier(DefaultRequestSignerFactory.java:111) at com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory.createRequestSigner(DefaultRequestSignerFactory.java:54) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:181) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:137) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:109) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:84) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:61) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:47) at com.oracle.bmc.objectstorage.ObjectStorageClient.(ObjectStorageClient.java:36)

at ObjectStorageSyncExample.main(ObjectStorageSyncExample.java:30)

skiman
  • 1
  • 1
  • What version of BouncyCastle are you using? The OCI Java SDK is using 1.52, because there were some problems with later versions. – Mathias Ricken Jul 13 '18 at 16:06
  • Thanks Mathias - As you mentioned this was a problem with BouncyCastle jar version. It was because of two BouncyCastle jars that were being loaded with different versions. Resolved when one of them was removed from the classpath. – skiman Jul 13 '18 at 19:52

1 Answers1

1

Just summarizing the above comments from skiman and myself:

What version of BouncyCastle are you using? The OCI Java SDK is using 1.52, because there were some problems with later versions.

If you are using a different version of BouncyCastle, or there are multiple versions of BouncyCastle, there will be problems. Make sure there is only one, and for the OCI Java SDK, that currently has to be version 1.52 of BouncyCastle.