oracle / oci-java-sdk

Oracle Cloud Infrastructure SDK for Java
https://cloud.oracle.com/cloud-infrastructure
Other
191 stars 152 forks source link

class file for com.oracle.bmc.http.internal.BaseSyncClient not found #551

Open udayinfy opened 9 months ago

udayinfy commented 9 months ago

With OCI SDK version 3.25.1 I am getting a build failure with below error:

[main] ERROR org.apache.maven.plugin.compiler.CompilerMojo - /mnt/docker/jenkins/workspace/Build_ppln_faw-etl-services/biapps-etl-services-war/src/main/java/oracle/apps/bi/etl/services/util/CommonETLUtils.java:[4872,9] cannot access com.oracle.bmc.http.internal.BaseSyncClient
  class file for com.oracle.bmc.http.internal.BaseSyncClient not found
[main] INFO org.apache.maven.plugin.compiler.CompilerMojo - 1 error

The error is thrown from the line where new SecretsClient(provider) is called.

InstancePrincipalsAuthenticationDetailsProvider provider = InstancePrincipalsAuthenticationDetailsProvider.builder().build();
        String secret;
        try (SecretsClient client = new SecretsClient(provider)){
            GetSecretBundleRequest getSecretBundleRequest = GetSecretBundleRequest.builder().secretId(secretOcid)
                    .stage(GetSecretBundleRequest.Stage.Current).build();

note: the same code has been working with older version e.g version 2.51.2

kishan0201 commented 9 months ago

@udayinfy This could be an issue of mixing and matching the versions, which is not supported and you have to change your project to make all these oci-java-sdk-* versions the same. You can run the attached shell script (in the same directory as your pom.xml) to check the same. check-oci-java-sdk-versions.sh.zip

jyotisaini commented 8 months ago

Hi @udayinfy Lets us know if the suggested workaround fixed your issue.