aidanwhiteley/books

MongoConverters warning message

aidanwhiteley opened this issue · 10 comments

Describe the bug
Since the upgrade from Spring Boot 2.1.8 to 2.1.9 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.

To Reproduce
Steps to reproduce the behavior:

  1. Simply run the Books test suite - mvn clean compile test

Expected behavior
The test suite should run without warning messages (other than those that relate to
a) running with a Spring profile that re-loads all data during the tests
b) runnign with a Spring profile that means CORS is enabled

Screenshots
n/a

Desktop (please complete the following information):

  • Version: Books 0.6.1-SNAPSHOT - when running with Spring Boot 2.1.9

Smartphone (please complete the following information):
n/a - same as desktop

Additional context
The problem has most likely been introduced by the upgraded Spring Data dependency in Spring Boot 2.1.9 - the dependency being uplifted Spring Data Lovelace-SR11.

The warning could probably be addressed by registering two org.springframework.core.convert.converter.Converter instances that address the warning detailed above.

However, as the above warnings have only just come in with the 2.1.9 upgrade and as the tests all still pass, I'm going to wait until 2.2.0 comes along before looking at this in any detail.

I have the same issue when running with Spring Boot 2.1.9. I downgraded to 2.1.8.

The same issue after upgrading to 2.1.9.
2.2.0 RC1 - the same behavior.

I'm having the same problem with spring boot 2.2.0.RELEASE.

This was introduced in spring-data-mongo 2.2.0

I'm having the same problem with spring boot 2.1.13. I this bug fixed in 2.2.x?

Still there is Spring Boot 2.2.5. However, its not a Spring Boot issue but an issue with one of its dependencies - see https://jira.spring.io/projects/DATAMONGO/issues/DATAMONGO-2400

As I like "clean logs" I'm currently logging at error level for the relevant class. Whether clean logs or seeing warning messages is more important depends on the application I guess.

<logger name="org.springframework.data.convert.CustomConversions" level="ERROR" />

<logger name="org.springframework.data.convert.CustomConversions" level="ERROR" />

little violence

I fixed it with adding to my application.yml:

logging:
  pattern.dateformat: yyyy-MM-dd HH:mm:ss.SSS,Europe/Minsk
  level:
    root: INFO
    org.springframework.data.convert.CustomConversions: ERROR

Housekeeping - closing old issues.
Not causing any real problem but still there in some shape or form - current warn logging

[main] WARN org.springframework.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 want to check your annotation setup at the converter implementation.