Since the upgrade from Spring Boot 2.1.8 to 2.1.9 and 2.2.0 the following warning messages have started to be logged when running the test suite
WARN 364 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
and
WARN 364 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
Comment From: wilkinsona
Thanks for the report. We'll need some more details to figure out what's happening and if the problem is caused by Spring Boot or by Spring Data.
the following warning messages have started to be logged when running the test suite
What test suite are you referring to?
To help us to diagnose the problem, can you please provide a complete and minimal example that reproduces the problem as a zip attached to this issue?
Comment From: aoudiamoncef
Hi @wilkinsona , There is a whole project which could reproduce the issue
This is my convert:
@Bean
public MongoCustomConversions customConversions() {
final List<Converter<?, ?>> converterList = new ArrayList<>();
converterList.add(new CityReadConverter());
...
return new MongoCustomConversions(converterList);
}
@ReadingConverter
public class CityReadConverter implements Converter<Document, City> {
@Override
public City convert(@NotNull final Document source) {
source.remove(METADATA);
final Date lastUpdate = source.get(LAST_UPDATE, Date.class);
if (Objects.nonNull(lastUpdate)) {
source.put(LAST_UPDATE, lastUpdate.toString());
}
...
return city;
}
}
At application startup:
2019-10-30 12:10:53.107 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class org.joda.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.115 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class org.joda.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.117 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.117 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.Instant to class java.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.367 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class org.joda.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.369 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class org.joda.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.370 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-30 12:10:53.370 [restartedMain] WARN o.s.data.convert.CustomConversions - Registering converter from class java.time.Instant to class java.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
The application doesn't run with 2.1.9 and 2.2.0.
Comment From: jntakpe
We experienced the same issue during Spring Boot 2.1 to 2.2 migration
Comment From: wilkinsona
An "empty" Spring Boot 2.1.9 application with a dependency on spring-boot-starter-data-mongodb
produces the following warnings on start up:
2019-10-31 10:19:00.137 WARN 87776 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-31 10:19:00.137 WARN 87776 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.Instant to class java.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-31 10:19:00.191 WARN 87776 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.LocalDateTime to class java.time.Instant as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
2019-10-31 10:19:00.192 WARN 87776 --- [ main] o.s.data.convert.CustomConversions : Registering converter from class java.time.Instant to class java.time.LocalDateTime as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
The warnings disappear upon downgrading to Spring Data Lovelace-SR10.
Comment From: wilkinsona
The change in behaviour appears to be caused by this commit in Spring Data MongoDB.
@Sparow199 Spring Data MongoDB uses JIRA for issue tracking. Can you please open an issue there and comment here with a link to it.
/cc @christophstrobl @mp911de
Comment From: rougou
Here is the link, btw. https://jira.spring.io/projects/DATAMONGO/issues/DATAMONGO-2400