79264558

Date: 2024-12-09 10:11:44
Score: 0.5
Natty:
Report link

Got the fix, exclude mongodb-driver if it is being included from any other dependency (it comes from debezium-connector-mongodb) and add it as such

    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongodb-driver-sync</artifactId>
        <version>4.11.2</version>
        <exclusions>
            <exclusion>
                <groupId>org.mongodb</groupId>
                <artifactId>mongodb-driver-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongodb-driver-core</artifactId>
        <version>4.11.2</version>
        <scope>compile</scope>
    </dependency>
    <!-- for getting real-time events, when it was giving NoSuchMethodError for changeStream.getSplitEvent() -->
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>bson</artifactId>
        <version>4.11.2</version>
    </dependency>

Adding the bson dependency solved it

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Rohit