我收到以下错误。当我使用mongo java驱动程序3.4.0的mongo atlas时。如果我使用mongo java驱动程序低于3.4.0版本我得到不同的错误。请提出一些建议
INFO:连接到服务器cluster时监视器线程中的异常0-shard-00-02-me1wd.mongodb.net:27017 com.mongodb.MongoSocketReadException:过早地到达流的末尾 在com.mongodb.connection.SocketStream.read(SocketStream.java:88) at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494) at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224) 在com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) 在com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) 在com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:85) at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:45) 在com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116) 在com.mongodb.connection.DefaultServerMonitor $ ServerMonitorRunnable.run(DefaultServerMonitor.java:113) 在java.lang.Thread.run(Thread.java:745)
2017年12月6日下午9:04:19 com.mongodb.diagnostics.logging.JULLogger日志 INFO:连接到服务器cluster0-shard-00-00-me1wd.mongodb.net:27017时监视器线程中的异常 com.mongodb.MongoSocketReadException:过早地到达流的末尾 在com.mongodb.connection.SocketStream.read(SocketStream.java:88) at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494) at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224) 在com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) 在com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) 在com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:85) at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:45) 在com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116) 在com.mongodb.connection.DefaultServerMonitor $ ServerMonitorRunnable.run(DefaultServerMonitor.java:113) 在java.lang.Thread.run(Thread.java:745)
2017年12月6日下午9:04:19 com.mongodb.diagnostics.logging.JULLogger日志 INFO:连接到服务器cluster时监视器线程中的异常0-shard-00-01-me1wd.mongodb.net:27017 com.mongodb.MongoSocketReadException:过早地到达流的末尾 在com.mongodb.connection.SocketStream.read(SocketStream.java:88) at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494) at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224) 在com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) 在com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) 在com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:85) at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:45) 在com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116) 在com.mongodb.connection.DefaultServerMonitor $ ServerMonitorRunnable.run(DefaultServerMonitor.java:113) 在java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:0)
这是我的错误....我在Atlas的证券中添加的IP地址已经改变了。我用新的IP&更新了它它工作正常。