zoukankan      html  css  js  c++  java
  • springboot之mongoDB项目Exception in monitor thread while connecting to server localhost:27017

    今天做好项目在自己电脑上测试均正常,但是部署到服务器上总是报

    查看上面内容发现我的数据库明明已经链接成功了

    想了想 是数据库配置链接了2次,因为我自己写了mongoDB的链接bean,而springboot又自动配置了一遍,而报错的是springboot自己配置的。

    解决办法:

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

    2、移除<!-<dependency> <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-data-mongodb</artifactId> 
    </dependency> 

        换成:<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver</artifactId>
    <version>3.4.2</version>
    </dependency>
    ---------------------
    作者:舒殊windy
    来源:CSDN
    转载原文:https://blog.csdn.net/w779050550/article/details/78741632
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    YOLO V5
    YOLO系列(单阶段目标检测)
    优化算法
    算法总结
    图像分类算法
    ResNet网络(里程碑)
    GoogleNet网络(纵横交错)
    VGGNet网络(走向深度)
    AlexNet网络(开山之作)
    案例
  • 原文地址:https://www.cnblogs.com/xyyou/p/11138394.html
Copyright © 2011-2022 走看看