Help Center> Document Database Service> User Guide> Troubleshooting> Java Driver Fails to Connect to the DB Instance, Leaving Message "Timeout while receiving message"

Java Driver Fails to Connect to the DB Instance, Leaving Message "Timeout while receiving message"

Symptom

An error is reported when you run the following command to connect to a DDS DB instance through Java driver:

Error message:

org.springframework.data.mongodb.UncategorizedMongoDbException: Timeout while receiving message; nested exception is com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message

Possible Cause

  • Abnormal slow queries occupy DB instance resources, causing the CPU usage to increase sharply or even reach the peak value.
  • The connection pool of the application is incorrectly configured. For example, the timeout interval is incorrectly set.

Solution