I am working on spring, flowable and mongodb.
here is my pow
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-engine</artifactId>
<version>6.6.0</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-process-engine-mongodb</artifactId>
<version>6.4.0.alpha1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
when running, it throws out an error
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.mongodb.MongoClientOptions.<init>(MongoClientOptions.java:149)
The following method did not exist:
'com.mongodb.connection.ConnectionPoolSettings$Builder com.mongodb.connection.ConnectionPoolSettings$Builder.maxWaitQueueSize(int)'
The method's class, com.mongodb.connection.ConnectionPoolSettings$Builder, is available from the following locations:
jar:file:/Users/abc/.m2/repository/org/mongodb/mongodb-driver-core/4.1.2/mongodb-driver-core-4.1.2.jar!/com/mongodb/connection/ConnectionPoolSettings$Builder.class
The class hierarchy was loaded from the following locations:
com.mongodb.connection.ConnectionPoolSettings.Builder: file:/Users/abc/.m2/repository/org/mongodb/mongodb-driver-core/4.1.2/mongodb-driver-core-4.1.2.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.mongodb.connection.ConnectionPoolSettings$Builder
firstly, i don't know where maxWaitQueueSize function is being used, because this function exists in mongodb driver 3.6.0-beta1 not in 4.x.x version,
I tried add the pom
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.6.0-beta1</version>
</dependency>
then running the pom with new errors saying
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.mongodb.MongoClientOptions.<init>(MongoClientOptions.java:149)
The following method did not exist:
'com.mongodb.connection.ConnectionPoolSettings$Builder com.mongodb.connection.ConnectionPoolSettings$Builder.maxWaitQueueSize(int)'
The method's class, com.mongodb.connection.ConnectionPoolSettings$Builder, is available from the following locations:
jar:file:/Users/abc/.m2/repository/org/mongodb/mongodb-driver-core/4.1.2/mongodb-driver-core-4.1.2.jar!/com/mongodb/connection/ConnectionPoolSettings$Builder.class
jar:file:/Users/abc/.m2/repository/org/mongodb/mongo-java-driver/3.6.0-beta1/mongo-java-driver-3.6.0-beta1.jar!/com/mongodb/connection/ConnectionPoolSettings$Builder.class
The class hierarchy was loaded from the following locations:
com.mongodb.connection.ConnectionPoolSettings.Builder: file:/Users/xisizhe/.m2/repository/org/mongodb/mongodb-driver-core/4.1.2/mongodb-driver-core-4.1.2.jar
I tried to delete the mongodb-driver-core-4.1.2.jar, but when running again the mongodb-driver-core-4.1.2.jar will be downloading automatically again, and the project will keep using the 4.1.2 version instead of mongo-java-driver-3.6.0 configured in the pom.xml
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.3.3.RELEASE:run (default-cli) > test-compile @ demo >>>
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver/3.8.2/mongodb-driver-3.8.2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver/3.8.2/mongodb-driver-3.8.2.pom (1.8 kB at 1.0 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/bson/4.0.5/bson-4.0.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/bson/4.0.5/bson-4.0.5.pom (1.3 kB at 2.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver-core/4.0.5/mongodb-driver-core-4.0.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver-core/4.0.5/mongodb-driver-core-4.0.5.pom (3.1 kB at 7.6 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver/3.8.2/mongodb-driver-3.8.2.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver-core/4.0.5/mongodb-driver-core-4.0.5.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/mongodb/bson/4.0.5/bson-4.0.5.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver/3.8.2/mongodb-driver-3.8.2.jar (320 kB at 339 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/bson/4.0.5/bson-4.0.5.jar (492 kB at 178 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver-core/4.0.5/mongodb-driver-core-4.0.5.jar (1.6 MB at 550 kB/s)
The thing puzzled me most is I don't configured any mongodb-driver-core-4.1.2 in the pom.xml, where it is coming from ?
is there a way to solve this?