在用springboot整合mongodb的过程中,启动项目,发现报错Caused by: java.lang.IllegalAccessError: failed to access class com.mongodb.client.internal.MongoClientDelegate from class com.mongodb.Mongo (com.mongodb.client.internal.MongoClientDelegate and com.mongodb.Mongo are in unnamed module of loader 'app'),,我springboot版本是2.1.17.RELEASE,而spring-boot-starter-data-mongodb版本却是2.6.3。两者版本不一致,所以client初始化失败了,将spring-boot-starter-data-mongodb版本改成2.1.17.RELEASE.问题解决。
springboot整合mongo启动报错
于 2022-07-13 16:51:37 首次发布