如何从应用程序启动中删除 Spring Data CustomConversions 警告? [英] How to remove Spring Data CustomConversions warnings from application startup?

查看:22
本文介绍了如何从应用程序启动中删除 Spring Data CustomConversions 警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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'

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

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.

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

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?

推荐答案

这段代码在2017年4月重构为spring data commons,注释是从原处复制过来的,没有改编.所以这里不是 mongo 特定的东西.

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.

添加:

一个问题相应的 PR 正在处理中.所以希望这些警告能尽快得到处理.

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.

这篇关于如何从应用程序启动中删除 Spring Data CustomConversions 警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆