java.lang.NoSuchMethodError during file upload using BlobClient

Negi, Richa 0 Reputation points
2024-02-27T05:08:18.3866667+00:00

Hi, We are using below azure-blob-storage version with springboot 3.1.6 and jdk 17. <dependency> <groupId>com.azure</groupId> <artifactId>azure-storage-blob</artifactId> <version>12.11.1</version> </dependency> When trying to upload a file using blob client, we are getting below error: "java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono reactor.core.publisher.Mono.subscriberContext(reactor.util.context.Context)'","\tat com.azure.storage.blob.BlobClient.uploadWithResponse(BlobClient.java:263)" Could you please help here? Thanks.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nehruji R 8,181 Reputation points Microsoft External Staff Moderator
    2024-02-27T06:13:42.3166667+00:00

    Hello Negi, Richa,

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    I understand that you are trying to upload a file using blob client and getting an error message.

    The error message you’re encountering, “java.lang.NoSuchMethodError: ‘reactor.core.publisher.Mono reactor.core.publisher.Mono.subscriberContext(reactor.util.context.Context)’”, indicates that there’s a compatibility issue between the versions of the Azure Blob Storage SDK and the Reactor library.

    Ensure that your Spring Boot version is compatible with the Azure Blob Storage SDK. According to the Spring Versions Mapping, Spring Boot 2.x requires Java 8 as the minimum version, while Spring Boot 3.x requires Java 17 or higher.

    refer - https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping for version compatibility.

    Also, you mentioned that you’re using the azure-storage-blob version 12.11.1. However, there might be a mismatch between the Spring Boot version and the Azure SDK version.

    Update your pom.xml file to include the correct dependencies for Spring Cloud Azure Storage Blob Starter. refer - https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-storage for more information.

    Hope this helps! Please let us know if you have any further queries. I’m happy to assist you further.

    Please 191316-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.