[JAVA-3444] NoSuchMethodError: com.mongodb.MongoClientSettings.getAutoEncryptionSettings Created: 24/Sep/19  Updated: 25/Sep/19  Resolved: 25/Sep/19

Status: Closed
Project: Java Driver
Component/s: Configuration
Affects Version/s: 3.11.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: nikolay belyaev Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux
spring-boot



 Description   

I import working module from my working project to new one. I want to show result in web with spring-boot possibilities. But got error

NoSuchMethodError: com.mongodb.MongoClientSettings.getAutoEncryptionSettings()Lcom/mongodb/AutoEncryptionSettings
I downgrade mongodb-driver-sync to 3.10.2 and all looks fine



 Comments   
Comment by Jeffrey Yemin [ 25/Sep/19 ]

me@werru.me

This is not a bug in the driver. The mongodb-driver-sync module depends on the mongodb-driver-core module, and the versions of each have to match. The method that you're seeing an error about was added in 3.11.0 of mongodb-driver-core. If it's missing in your deployment, then you must be loading an older version of mongodb-driver-core.

Comment by nikolay belyaev [ 24/Sep/19 ]

No. I checked classes that loaded during boot.

It was MongoClientSettings and MongoClientSettings.$Builder (can mistake in name) only one time each

Comment by Jeffrey Yemin [ 24/Sep/19 ]

Understood, but it sounds like you have a spring boot dependency, and that may have a dependency on an older version of mongodb-driver-core.

Comment by nikolay belyaev [ 24/Sep/19 ]

I had only one dependency connected with mongo
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>3.11.0</version>
</dependency>

 

Comment by Jeffrey Yemin [ 24/Sep/19 ]

If you're going to upgrade mongodb-driver-sync to 3.11.0, you also need to ensure that mongodb-driver-core is on the same version.

Generated at Thu Feb 08 08:59:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.