javaspring-bootmavencouchbasespring-data-couchbase

Spring Boot 3.2.2 with Couchbase Java Client 2.7 - Connection Established and then Disconnected


I am working on a Spring Boot application (version 3.2.2) and I am trying to connect to Couchbase using the Couchbase Java Client (version 2.7). However, I am encountering an issue where the connection to Couchbase is established but then immediately disconnected.

Here are the dependencies I am using:

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-couchbase</artifactId>
    <version>3.2.12.RELEASE</version>
</dependency>
<dependency>
    <groupId>com.couchbase.client</groupId>
    <artifactId>java-client</artifactId>
    <version>2.7.18</version>
</dependency>

The error message I am seeing is:

Factory method 'mappingCouchbaseConverter' threw exception with message: org/springframework/data/convert/EntityInstantiators

.

I have tried the following solutions but none of them worked:

Cleaned and rebuilt the project. Checked for version conflicts using the mvn dependency:tree command. Created a minimal reproducible example. I would appreciate any help or guidance on how to resolve this issue. Thank you in advance!


Solution

  • Factory method 'mappingCouchbaseConverter' threw exception with message: org/springframework/data/convert/EntityInstantiators

    mappingCouchbaseConverter is a spring-data-couchbase method. The spring-data-couchbase that has the Couchbase Java SDK 2.7 dependency is not for Spring 3.x. Please use a spring-data-couchbase version that which will work on your version of Spring Boot. Spring Initialzr will help you with the versions. You can just create dummy project, then get the versions from the project definition.