【问题标题】:spring-data-elasticsearch compatibility with spring bootspring-data-elasticsearch 与 spring boot 的兼容性
【发布时间】:2018-02-01 02:26:18
【问题描述】:

我能够使用 spring-data-elasticsearch 3.0.0.RC2 连接到 Elastic Serarch 5.5.0

我想将我的应用程序转换为 Spring Boot 应用程序。我尝试了 Spring Boot 版本 2.0.0.M2 ,但出现以下错误

Caused by: java.lang.NoSuchMethodError: org.springframework.data.elasticsearch.c
ore.mapping.ElasticsearchPersistentProperty.findAnnotation(Ljava/lang/Class;)Lja
va/lang/annotation/Annotation;
        at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsear
chPersistentEntity.addPersistentProperty(SimpleElasticsearchPersistentEntity.jav
a:157) ~[spring-data-elasticsearch-3.0.0.RC2.jar!/:?]
        at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsear
chPersistentEntity.addPersistentProperty(SimpleElasticsearchPersistentEntity.jav
a:47) ~[spring-data-elasticsearch-3.0.0.RC2.jar!/:?]
        at org.springframework.data.mapping.context.AbstractMappingContext$Persi
stentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:559)
~[spring-data-commons-2.0.0.M4.jar!/:?]
        at org.springframework.data.mapping.context.AbstractMappingContext$Persi
stentPropertyCreator.doWith(AbstractMappingContext.java:528) ~[spring-data-commo
ns-2.0.0.M4.jar!/:?]
        at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils
.java:727) ~[spring-core-5.0.0.RC2.jar!/:5.0.0.RC2]

根据以下链接版本矩阵,Spring Boot 不适用于 Elastic Search 5 版本。

https://github.com/spring-projects/spring-data-elasticsearch/wiki/Spring-Data-Elasticsearch---Spring-Boot---version-matrix

但我觉得这个矩阵已经过时了,因为 spring-data-elasticsearch 已经开始支持 ElasticSearch-5.5.0

如果您可以使用 Spring Boot 成功运行连接到 Elastic Search 5 的 spring-data-elasticsearch,请告诉我。

【问题讨论】:

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


    【解决方案1】:

    当我将 spring-boot-starter-parent 升级到 2.0.0.M3

    时它工作正常

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-13
      • 2020-09-03
      • 2019-08-27
      • 2016-12-23
      • 2016-08-26
      • 2019-12-30
      • 1970-01-01
      相关资源
      最近更新 更多