• [main] INFO com.course.Application


     启动springboot程序的时候出现 了这个问题:

    2020-01-10 11:27:12.918 [main] INFO com.course.Application - Started Application in 11.272 seconds (JVM running for 13.498)
    2020-01-10 11:27:13.143 [cluster-ClusterId{value='5e17ef0f1961c94ad6c394a2', description='null'}-localhost:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server localhost:27017
    com.mongodb.MongoSocketOpenException: Exception opening socket
    at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70)
    at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
    at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:64)
    at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
    at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
    ... 3 common frames omitted

    解决办法

    在启动类添加注解排除MongoAutoConfiguration:

    @SpringBootApplication(exclude = MongoAutoConfiguration.class)

  • 相关阅读:
    RabbitMQ 入门
    Spring boot 2.x 中使用redis
    spring boot 中 Cache 的使用
    vbs 入门
    移动端文本框被原生键盘弹出后挡住文本框
    HTML中添加音乐video embed audio
    input修改placeholder文字颜色
    vue中更换.ico图标报错路径找不到图片
    Chrome表单文本框自动填充黄色背景色样式
    请求头缺少 'Access-Control-Allow-Origin'
  • 原文地址:https://www.cnblogs.com/yuan1225/p/12175541.html
Copyright © 2020-2023  润新知