Skip to content

ObjectMapper provided by JacksonAutoConfiguration via JacksonClusterEnvironmentBuilderCustomizer breaks Couchbase driver #26363

@mp911de

Description

@mp911de

When using Spring Boot defaults with Couchbase, then Couchbase operations are affected by the ObjectMapper that gets configured by Spring Boot causing driver failures. Something like:

com.couchbase.client.core.error.CouchbaseException: query did not project __id. Either use #{#n1ql.selectEntity} or project __id and __cas : SELECT META(`travel-sample`).id AS __id, META(`travel-sample`).cas AS __cas, `name`, `iata`, `icao`, `callsign`, `country` FROM `travel-sample` WHERE `_class` = "example.springdata.couchbase.model.Airline"

Couchbase driver requires a specific Jackson Module to be registered that is shipped with the driver (com.couchbase.client.java.json.JsonValueModule) so that Couchbase's JsonObject and JsonArray can be used for JSON exchange.

I'd recommend improving the arrangement by registering JsonValueModule when Couchbase is on the classpath and when JacksonClusterEnvironmentBuilderCustomizer is used.

/cc @mikereiche

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions