Error occurs java.lang.NoSuchMethodError: reactor.core.publisher.MonoSink.contextView() after updating Quarkus version

Banula Kumarage 0 Reputation points
2023-03-13T06:24:53.6366667+00:00

I have updated the quarkus version of the project from 2.13.final to 2.16.4 final. Then it gives an error as follows. java.lang.NoSuchMethodError: reactor.core.publisher.MonoSink.contextView()

The dependency tree of reactor.core is as follows.

+- com.azure:azure-storage-blob:jar:12.12.0:compile
[INFO] |  +- com.azure:azure-core:jar:1.37.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.14.2:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-core:jar:2.14.2:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.14.2:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.14.2:compile
[INFO] |  |  \- io.projectreactor:reactor-core:jar:3.4.7:compile

As mentioned in java.lang.NoSuchMethodError: 'reactor.util.context.ContextView reactor.core.publisher.MonoSink.contextView()' I tried changing the version of reactor-core. But it didn't fix the issue.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,413 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 43,401 Reputation points Microsoft Employee
    2023-03-13T13:38:08.6833333+00:00

    @Banula Kumarage Welcome to Microsoft Q&A Forum, Thank you for posting your query here

    This error typically occurs when there is a version mismatch between the reactor-core library used by your project and the version of reactor-core expected by one of its dependencies. In this case, it looks like the azure-storage-blob library is bringing in an older version of reactor-core (3.4.7) that is not compatible with the version of reactor-core your project is using (presumably 3.4.9 or higher).

    To resolve this issue, you can try explicitly excluding the transitive dependency on reactor-core from the azure-storage-blob library in your pom.xml file or build.gradle file, and then adding a direct dependency on the version of reactor-core that your project is using. Here's an example of how to do this in a Maven project:

    pom.xml

     

    <dependency>
      <groupId>com.azure</groupId>
      <artifactId>azure-storage-blob</artifactId>
      <version>12.12.0</version>
      <exclusions>
        <exclusion>
          <groupId>io.projectreactor</groupId>
          <artifactId>reactor-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    Then, you can add a direct dependency on the version of reactor-core that your project is using:

    <dependency>
      <groupId>io.projectreactor</groupId>
      <artifactId>reactor-core</artifactId>
      <version>3.4.9</version>
    </dependency>

    This should ensure that your project is using the correct version of reactor-core and that there are no conflicts with other dependencies that require a different version.

       

    If you have any additional questions or need further clarification, please let me know.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

     

     


  2. Sagar Sunil 0 Reputation points
    2023-11-06T07:55:15.7066667+00:00

    Getting the same error after upgrading Spring Boot 3.1.4 and after downgrading reactor core to 3.4.19 version, it works.

    <dependency>
      <groupId>io.projectreactor</groupId>
      <artifactId>reactor-core</artifactId>
      <version>3.4.9</version>
    </dependency>
    
    0 comments No comments