Ошибка при подключении Mongo DB 3.8.1 с использованием Java 8 - PullRequest
0 голосов
/ 11 сентября 2018
*While trying to connect mongodb using java in windows I am getting below error*

    NFO: Exception in monitor thread while connecting to server localhost:27018
    com.mongodb.MongoSocketOpenException: Exception opening socket
        at com.mongodb.internal.connection.SocketChannelStream.open(SocketChannelStream.java:60)
        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(Unknown Source)
    Caused by: java.net.ConnectException: Connection refused: no further information
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
        at sun.nio.ch.SocketAdaptor.connect(Unknown Source)
        at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:64)
        at com.mongodb.internal.connection.SocketChannelStream.open(SocketChannelStream.java:57)
        ... 3 more

Примечание: - У меня есть Mongo DB 4.0.2 и используется порт 27017 и локальный хост хоста.

Пожалуйста, помогите.

...