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

标签 spring-boot spring-data spring-data-elasticsearch

我有一个具有以下 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'的私有(private)方法,它的javadoc提到了Mongo类型,很奇怪,因为我们没有使用 Mongo。这个 Mongo 引用正确吗?

但主要问题是,有没有办法避免/删除这些警告?

最佳答案

我通过添加到我的 application.yml 来修复它:

logging.level.org.springframework.data.convert.CustomConversions: ERROR

关于spring-boot - 如何从应用程序启动中删除 Spring Data CustomConversions 警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60001034/

相关文章:

java - 未使用的 Bean 在 Spring App 中被调用

java - 如何正确使用Spring Security中的hasRole?

java - Spring Security - 尽管允许所有请求但未经授权

java - Spring-Data-Jpa Repository - 实体列名上的下划线

spring - 带有Shield的Spring Data Elasticsearch

spring - Spring Data ElasticSearch NullPointerException

java - 如何在 Spring Boot 中用 yml 文件替换属性文件

elasticsearch - spring-data-elasticsearch 的 Multi-Tenancy

java - 未找到索引异常

java - 更新到SDN 3.4.1后出现异常 "The Neo Server running is of unknown type."