Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3842

Mac os can connect to remotely Mongo 4.2.9 while Ubuntu can't

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.1.0
    • Component/s: Configuration
    • None
    • Environment:
      Mac os -> Catalina 10.150.6
      Ubuntu os -> 20.04.1 LTS Focal
    • Needed

      When I connect my Java Project using the below maven dependencies to Mongo 4.2.9 that was hosted remotely, If I'm using Macos, it will connects successfully.

      		<dependency>
      			<groupId>org.springframework.data</groupId>
      			<artifactId>spring-data-mongodb</artifactId>
      			<version>3.0.3.RELEASE</version>
      		</dependency>
      
      
      		<dependency>
      			<groupId>org.mongodb</groupId>
      			<artifactId>mongodb-driver-core</artifactId>
      			<version>4.1.0</version>
      		</dependency>
      
      
      		<dependency>
      			<groupId>org.mongodb</groupId>
      			<artifactId>mongodb-driver-sync</artifactId>
      			<version>4.0.1</version>
      		</dependency>
      

      When I was using Ubuntu, it will fail with the below exception:

      java.lang.NoSuchMethodError: 'java.lang.String com.mongodb.connection.ClusterSettings.getDescription()'
      

      But If I changed the dependencies to be like below:

      		<dependency>
      			<groupId>org.springframework.data</groupId>
      			<artifactId>spring-data-mongodb</artifactId>
      			<version>3.0.1.RELEASE</version>
      		</dependency>
      
      
      		<dependency>
      			<groupId>org.mongodb</groupId>
      			<artifactId>mongodb-driver-core</artifactId>
      			<version>4.0.4</version>
      		</dependency>
      
      
      		<dependency>
      			<groupId>org.mongodb</groupId>
      			<artifactId>mongodb-driver-sync</artifactId>
      			<version>4.0.4</version>
      		</dependency>
      

      It will fail to connect to Mongo 4.2.9 even on Mac or Ubuntu.

       

      The error on Mac is:

      nested exception is java.lang.NoSuchMethodError: 'java.lang.String com.mongodb.connection.ClusterSettings.getDescription()'
      

      while the error on Ubuntu is:

      nested exception is java.lang.NoSuchMethodError: 'void com.mongodb.internal.connection.DefaultClusterableServerFactory.<init>(..)

       

        1. image.png
          217 kB
          Mohammad Amr
        2. image (1).png
          283 kB
          Mohammad Amr

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            mohammad.amr@baaz.com Mohammad Amr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: