-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
With RethinkDB Java Driver 2.4.4, if an OffsetDateTime is being saved, following error occurs:
java.lang.IllegalArgumentException: Java 8 date/time type java.time.OffsetDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: ch.yourpackage.YourClass["yourField"])
I state that com.fasterxml.jackson.datatype:jackson-datatype-jsr310 is already in my build.gradle file.
To avoid the above issue, as a workaround I need to include this line during RethinkDB initializer:
RethinkDB.setResultMapper(RethinkDB.getResultMapper().findAndRegisterModules());
My advice would be to modify your getResultMapper() method in the RethinkDB.java class as follows:
public synchronized static @NotNull ObjectMapper getResultMapper() {
ObjectMapper mapper = resultMapper;
if (mapper == null) {
mapper = new ObjectMapper()
.findAndRegisterModules() // This line should be the new one
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
resultMapper = mapper;
}
return mapper;
}
Metadata
Metadata
Assignees
Labels
No labels