1

I am facing an issue in a spring boot mongodb application, where I am getting the following exception

java.lang.NoSuchMethodError: 'com.mongodb.connection.ConnectionPoolSettings$Builder
com.mongodb.connection.ConnectionPoolSettings$Builder.maxWaitQueueSize(int)

From what I found, I have to update the mongodb-driver version to a version higher than 3.5. The current version in use is 3.2.2

In the application's pom.xml, there is no mongodb-driver dependency at all. From my understanding, some other dependency is downloading this mongodb-driver jar. How to find out which dependency is downloading it and how to make that particular dependency download a higher version of mongodb-driver jar?

Ann
  • 137
  • 1
  • 11
  • 3
    You can use the [dependency plugin `tree`](https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html) command to find out the source. – Naman Aug 25 '21 at 03:41
  • What is your spring boot version ? – R.G Aug 25 '21 at 03:44
  • @R.G I am using springboot version 1.4.2 – Ann Aug 25 '21 at 04:11
  • 2
    If you can upgrade the spring boot version , the latest supported `mongodb-driver-core` version is `4.2.3` . [reference](https://docs.spring.io/spring-boot/docs/current/reference/html/dependency-versions.html) – R.G Aug 25 '21 at 04:14

1 Answers1

5

You have two options:

Eclipse IDE

  • open your maven project
  • open the pom.xml
  • click on dependency hierarchy
  • put the name (or part) of the jar in the search box
  • you will see the tree of dependencies related to your jar

mvn

Using maven plugin

As @Naman said, you can use the dependency:tree plugin.

You just need maven on your shell. To see the complete tree, execute this:

mvn dependency:tree or search with wildcards

mvn dependency:tree -Dincludes=*common*

mvn-tree

JRichardsz
  • 14,356
  • 6
  • 59
  • 94