***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.mongo.MongoClientFactorySupport.applyUuidRepresentation(MongoClientFactorySupport.java:85)
The following method did not exist:
com.mongodb.MongoClientSettings$Builder.uuidRepresentation(Lorg/bson/UuidRepresentation;)Lcom/mongodb/MongoClientSettings$Builder;
The method's class, com.mongodb.MongoClientSettings$Builder, is available from the following locations:
jar:file:/D:/Document/MavenRepository/org/mongodb/mongodb-driver-core/3.9.1/mongodb-driver-core-3.9.1.jar!/com/mongodb/MongoClientSettings$Builder.class
The class hierarchy was loaded from the following locations:
com.mongodb.MongoClientSettings.Builder: file:/D:/Document/MavenRepository/org/mongodb/mongodb-driver-core/3.9.1/mongodb-driver-core-3.9.1.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.mongodb.MongoClientSettings$Builder
无论怎么排查都解决不了。后来把模块整个删了从新创建都没用;
然后我发现东西都删完了还提示我Mongo有问题。。我就排查主pom文件
发现定义了一个
<!-- 集中定义依赖版本号 -->
<properties>
<mongodb.version>3.9.1</mongodb.version>
</properties>
简直坑爹阿,,,这个会影响到mongo的版本的。询问之下得知原来是需要指定版本的,后来取消了,参数没有删除,恰巧springboot内部定义了mongo的版本,刚好也是使用这个变量名,所以就修改了版本,导致了这个bug,,
解决:
删除版本号,或者自己手动定义一个版本号给他