Home » Java » exception com.mongodb.MongoSocketWriteException: Exception sending message

exception com.mongodb.MongoSocketWriteException: Exception sending message

Posted by: admin July 23, 2018 Leave a comment

Questions:

My application was deployed on Google cloud (both of Mongodb server & client), and sometime it got the following exception. The application is using Java mongodb-driver 3.6.2.
Please tell me why this happen, and how can I fix this issue.

ERROR, http-thread-pool(4), reallife.food.agent.response.ResponseDataImpl, exception com.mongodb.MongoSocketWriteException: Exception sending message at com.mongodb.connection.InternalStreamConnection.translateWriteException(InternalStreamConnection.java:518) ~[mongodb-driver-core-3.6.2.jar:?] at com.mongodb.connection.InternalStreamConnection.sendMessage(InternalStreamConnection.java:406) ~[mongodb-driver-core-3.6.2.jar:?] at com.mongodb.connection.InternalStreamConnection.sendCommandMessage(InternalStreamConnection.java:270) ~[mongodb-driver-core-3.6.2.jar:?] at com.mongodb.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:253) ~[mongodb-driver-core-3.6.2.jar:?] at

xxx

org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) ~[nucleus-grizzly-all.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:115) ~[?:1.8.0_161] at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[?:1.8.0_161] at com.mongodb.connection.SocketStream.write(SocketStream.java:74) ~[mongodb-driver-core-3.6.2.jar:?] at com.mongodb.connection.InternalStreamConnection.sendMessage(InternalStreamConnection.java:403) ~[mongodb-driver-core-3.6.2.jar:?]

Answers: