spring-data-elasticsearch与spring boot的兼容性

时间:2017-08-23 13:09:58

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

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

我想将我的应用转换为弹簧启动应用程序。我尝试了 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]

根据以下链接版本矩阵,弹簧启动不适用于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,请告诉我。

1 个答案:

答案 0 :(得分:0)

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

时,它工作正常