How to remove Spring Data CustomConversions warnings from application startup?

给你一囗甜甜゛ 提交于 2021-01-03 05:05:28

问题


I have an application with the following Spring dependencies:

starterBase    : 'org.springframework.boot:spring-boot-starter:2.2.1.RELEASE',
starterActuator: 'org.springframework.boot:spring-boot-starter-actuator:2.2.1.RELEASE',
starterJpa     : 'org.springframework.boot:spring-boot-starter-data-jpa:2.2.1.RELEASE',
starterTest    : 'org.springframework.boot:spring-boot-starter-test:2.2.1.RELEASE',
starterWeb     : 'org.springframework.boot:spring-boot-starter-web:2.2.1.RELEASE',
elasticsearch  : 'org.springframework.boot:spring-boot-starter-data-elasticsearch:2.2.1.RELEASE'

In the moment that I added the elasticsearch dependency, the following Warnings appeared when I start the application:

WARN  [main] o.s.data.convert.CustomConversions.register - Registering converter from class org.springframework.data.geo.Point to interface java.util.Map as writing converter although it doesn't convert to a store-supported type! You might wanna check you annotation setup at the converter implementation.
WARN  [main] o.s.data.convert.CustomConversions.register - Registering converter from interface java.util.Map to class org.springframework.data.geo.Point as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.
WARN  [main] o.s.data.convert.CustomConversions.register - Registering converter from class org.springframework.data.elasticsearch.core.geo.GeoPoint to interface java.util.Map as writing converter although it doesn't convert to a store-supported type! You might wanna check you annotation setup at the converter implementation.
WARN  [main] o.s.data.convert.CustomConversions.register - Registering converter from interface java.util.Map to class org.springframework.data.elasticsearch.core.geo.GeoPoint as reading converter although it doesn't convert from a store-supported type! You might wanna check you annotation setup at the converter implementation.

I debugged the code, and in spring-data-commons:2.2.1-RELEASE in CustomConversions.java, there is a private method with name 'register' in line 196, and its javadoc mentions the Mongo types, and it is strange, because we are not using Mongo. Is this Mongo reference correct?

But the main question is, is there any way to avoid/remove these warnings?


回答1:


This code was refactored into spring data commons in April 2017, and the comment was copied from the original place and not adapted. So this is no mongo specific stuff here.

As for the warnings, all you can do at the moment is ignore them, we'll check if we need these at all.

Addition:

there is an issue for that, the corrsponding PR is in the pipeline of being processed. So hopefully these warnings will be dealed with soon.




回答2:


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


来源:https://stackoverflow.com/questions/60001034/how-to-remove-spring-data-customconversions-warnings-from-application-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!