已解决com.mongodb.MongoSocketOpenException: Exception opening socket

Posted up up!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了已解决com.mongodb.MongoSocketOpenException: Exception opening socket相关的知识,希望对你有一定的参考价值。

启动SpringBoot项目时,报错如下信息

com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:67)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:126)
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 (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
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.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.open(SocketStream.java:62)
… 3 common frames omitted

在这里插入图片描述
解决方法:
在SpringBoot项目的启动类上添加
@SpringBootApplication(exclude = MongoAutoConfiguration.class)

以上是关于已解决com.mongodb.MongoSocketOpenException: Exception opening socket的主要内容,如果未能解决你的问题,请参考以下文章

解决Firefox已阻止运行早期版本Adobe Flash

Gamma阶段测试报告

如何让 youtrack 不显示已解决的问题

如何在合并提交中列出已解决冲突的统计信息?

ERROR ITMS-90022,90023,问题已解决

如何解决“已启用矢量粉碎保护”?