报错解决 Exception in monitor thread while connecting to server localhost:27017com.mongodb

Myth丶恋晨 2024-03-26 19:00 146阅读 0赞

报错解决 Exception in monitor thread while connecting to server localhost:27017com.mongodb

Springboot默认启用MongoDB,如果没有集成MongoDB在启动项目时会抛出异常:Exception in monitor thread while connecting to server localhost:27017;

只需要在启动类中修改注解:

将注解:

  1. @SpringBootApplication

改为

  1. @SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})

即可禁用springboot自带的mongodb配置,项目启动正常。

发表评论

表情:
评论列表 (有 0 条评论,146人围观)

还没有评论,来说两句吧...

相关阅读