温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - How to remove Spring Data CustomConversions warnings from application startup?

其他 - 如何从应用程序启动中删除Spring Data CustomConversions警告?

发布于 2020-03-27 16:20:32

我有一个具有以下Spring依赖项的应用程序:

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'

在添加elasticsearch依赖项的那一刻,启动应用程序时出现以下警告:

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.

我调试了代码,并在CustomConversions.java中的spring-data-commons:2.2.1-RELEASE中,在第196行有一个名为“ register”的私有方法,它的javadoc提到了Mongo类型,这很奇怪,因为我们没有使用Mongo。该Mongo参考正确吗?

但是主要的问题是,有什么办法可以避免/消除这些警告?

查看更多

查看更多

提问者
Iker Aguayo
被浏览
400
P.J.Meisch 2020-01-31 21:19

该代码于2017年4月被重构为Spring数据共享区,并且注释是从原始位置复制而未改编的。因此,这不是mongo专用的东西。

至于警告,目前您只能忽略它们,我们将检查是否需要这些警告。

加成:

一个问题是,相应的PR正在处理中。因此,希望这些警告能够尽快得到解决。

发布
问题

分享
好友

手机
浏览

扫码手机浏览