Exception is com.mongodb.MongoSocketWriteException: Exception sending message

Trying to connect with serverless(5.1) mongo instance.
Spring Boot version: 2.6.0
Mongo driver: 4.4.0

Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name ‘graphQLServletRegistrationBean’ defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘graphQLServletRegistrationBean’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘graphQLHttpServlet’ defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘graphQLHttpServlet’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘graphQLServletConfiguration’ defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘graphQLServletConfiguration’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘invocationInputFactory’ defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘invocationInputFactory’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘graphQLSchemaProvider’ defined in class path resource [graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘graphQLSchemaProvider’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘graphQLSchema’ defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘graphQLSchema’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘schemaParser’ defined in class path resource [graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘schemaParser’ parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘AccountMutationResolverAuthVersion’: Unsatisfied dependency expressed through field ‘accountService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘accountServiceImpl’: Unsatisfied dependency expressed through field ‘digiCardService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘digiCardServiceImpl’: Unsatisfied dependency expressed through field ‘mongoTemplate’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mongoTemplate’ defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/MongoDatabaseFactoryDependentConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.core.MongoTemplate]: Factory method ‘mongoTemplate’ threw exception; nested exception is org.springframework.dao.DataAccessResourceFailureException: Exception sending message; nested exception is com.mongodb.MongoSocketWriteException: Exception sending message"}

Hi Team,

Can you please help me on this. It’s something urgent.
Thanks in advance.

Hi Team,

Adding some more clarification points below:

  1. Upgrading existing spring boot application from 2.3.5 to 2.6.0.
  2. Upgraded mongo driver(4.4.0) manually.
    After doing the required changes, Still getting above exception. Need urgent help.

Thanks,
Santosh