Trying to upgrade to Mongo Driver 5.0

Current Mongo Driver version: 4.11.1
Current Spring Boot version: 3.2.5

When upgrading to Mongo Driver 5.x, we are encountering a MethodNotFound issue with Spring Boot, due to:


The following method did not exist:
‘com.mongodb.connection.StreamFactoryFactory com.mongodb.MongoClientSettings.getStreamFactoryFactory()’

May I ask if someone else is having the similar issue? and not sure if Spring side is working on to remove that code reference
Thank you!

Hi William,

Those were deprecated methods and are removed in the 5.0 major release.

Please follow below guides to update your code with the alternatives ( Use the MongoClientSettings.getTransportSettings() method)

@Rishabh_Bisht Thank you for the reply!

Also just noticing that Spring team is making update for this: Upgrade to MongoDB 5.0 · spring-projects/spring-boot@35bc0f9 · GitHub
Will just wait for their next release

Hi @williamwjs thanks for reaching out about this, and excited to hear that you’re planning to upgrade to the 5.x version of the Java Driver. Yes, sometimes Spring support for a new version can trail our release. In this case, they are planning to include the 5.x major version change in their upcoming release (see this RC of their upcoming release here). Feel free to reach out if you have any more questions, or if you have feedback on building with MongoDB and Spring!


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.