2

I am accessing the Azure blob from spring boot application as mentioned in the documentation, I have included the following JAR,

        <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-storage-blob</artifactId>
        <version>12.12.0</version>
        </dependency>

Then I am using the following code to list down files in Azure blob,

            BlobContainerClient blobContainerClient = new BlobContainerClientBuilder()
                .endpoint(fileServerURL + "/" + containerName + "/test/123" + "?" + sasToken)
                .buildClient();

I am accessing the blob inside the container and listing the files,

blobContainerClient.listBlobs()
                            .stream().<<mycode>>

When I try to debug, breakpoints runs after line 2, exactly at the .endpoint() method call. No stacktrace which is weird (I tried to enclose within try/catch) but no use. I get the following exception in the client,

Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.azure.storage.blob.implementation.util.ModelHelper
arunan
  • 922
  • 1
  • 17
  • 25
  • NoClassDefFound typically means there's an issue with dependency resolution, Being in a spring boot environment (I think sometimes spring boot environments can try to pull in their own versions of the sdk and if your project tries to use one that doesn't match it may fail in the way you're seeing) Can you try getting a dependency tree and we can start from there? – SumanthMarigowda-MSFT Jun 24 '21 at 17:31

0 Answers0