spring-data-elasticsearch compatibility with spring boot - elasticsearch

I was able to connect to Elastic Serarch 5.5.0 using spring-data-elasticsearch 3.0.0.RC2.
I want to convert my app into a spring boot application. I tried Spring Boot version 2.0.0.M2 , but I got the below error
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]
As per the below link version matrix , spring boot is not available for Elastic Search 5 version.
https://github.com/spring-projects/spring-data-elasticsearch/wiki/Spring-Data-Elasticsearch---Spring-Boot---version-matrix
But I feel this matrix is out dated since spring-data-elasticsearch has already started to support ElasticSearch-5.5.0
Let me know if you could successfully run spring-data-elasticsearch connecting to Elastic Search 5 using Spring Boot .

It works fine when I upgraded spring-boot-starter-parent to 2.0.0.M3

Related

Hibernate Search breaks with Spring Boot 2.3.0

When i migrated one of my Hibernate Search project from Spring Boot 2.2.7.RELEASE to 2.3.0.RELEASE, application started facing deadlock during the very startup.
I can not see any error in the logs either.
My sample project is here:
https://github.com/cancerian0684/listing-service
If i rollback Spring Boot 2.3.0 to 2.2.7, everything started working fine again. Is there a known issue in using Hibernate Search (tried both 5.x and 6.0.0.Beta8) with Spring Boot 2.3.0?
Spring Boot 2.3 switched to deferred JPA initialization and that leads to some issue, Hibernate Search being one of them. You should be able to get it back working using the following property
spring.data.jpa.repositories.bootstrap-mode=default
See this issue for some more context.

Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.IndicesClient

Getting Error Like
An attempt was made to call the method org.elasticsearch.client.IndicesClient.create(Lorg/elasticsearch/action/admin/indices/create/CreateIndexRequest;[Lorg/apache/http/Header;)
Lorg/elasticsearch/action/admin/indices/create/CreateIndexResponse; but it does not exist. Its class, org.elasticsearch.client.IndicesClient, is available from the following locations:
jar:file:/audit.jar!/BOOT-INF/lib/elasticsearch-rest-high-level-client-6.7.0.jar!/org/elasticsearch/client/IndicesClient.class
It was loaded from the following location:
jar:file:/audit.jar!/BOOT-INF/lib/elasticsearch-rest-high-level-client-6.7.0.jar!
Please Help me out to solve this issue
Spring Boot 2.1.x uses Spring Data Elasticsearch 3.1.x which in turn is built against the libraries of Elasticsearch 6.2.2.
If you want to use Elasticsearch 6.8.5 you need to upgrade your Spring Data Elasticsearch version to 3.2.3 which is built against Elasticsearch 6.8.4.
I don't know if Spring Boot 2.1.0 can handle this in it's autoconfiguration, you might have to annotate your application with:
#SpringBootApplication(exclude = ElasticsearchDataAutoConfiguration.class)
and configure Spring Data Elasticsearch by yourself.

Spring Data Elasticsearch 3.0.6 - Compatibility

I am wondering which version of Elasticsearch does Spring Data Elasticsearch 3.0.6 support?
Currently I am working with Elasticsearch 6.2, is this compatible?
Right now I am using the Elasticsearch Rest Client for Java, but since I am using Spring I thought about using Spring Data Elasticsearch.
According to the POM of the 3.0.6 release, the supported version is 5.5.0

ElasticSearch 5.1.1 support on Spring Boot 1.4.1

I'm trying to connect to ES cluster version 5.1.1 on AWS and I'm getting error
java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
The application is built using spring-boot-starter-data-elasticsearch. The same app works with ES 2.4 version so I'm thinking this is version compatibility issue. Is there a upgrade or support for ES 5.1.1 in Spring Boot and Spring Data ?
As of today the currently supported elastic search version is elaseticsearch 2.x(*<5) if you're using the available stable release of spring data elastic search(2.x) as you can see in this compatibility matrix link.
I believe that support for elastic search 5.x is planned for spring data elasticsearch(need confirmation) 3.x that is currently M1 but then I think you need to bump also your spring boot version.

Does Spring-data-elasticsearch works with Spring 3.1.2 version?

I would like to use the spring data elastic search capability with spring 3.1.2. Does spring data elastic search works with spring 3.1.2 version.?
Spring elastic search is available under spring data release of 1.1x and 1.3x. Spring Data 1.1x required Java 1.6 or later. Spring Data 1.3x required Java 1.7 or later.
You are relating SpringData elastic search functionality with SpringFramework version. It does all dependent on which java version you are supposed going to using. Please find the detail and supporting link below for your reference.
Spring framework requirment noted below. You can find them under Mininum Requirment section in the Link
Minimum requirements of Spring Framework
•JDK 6+ for Spring Framework 4.x
•JDK 5+ for Spring Framework 3.x
Spring data elastic search minimun requrirment noted down. You can find them under note section of below Link
Minimum requirements for elastic search
Spring data elaticsearch until 1.0.0.RELEASE version is on
elasticsearch 1.1.x library, which uses java 1.6 or later version
From spring data elasticsearch 1.1.0.RELEASE the version of
elasticsearch is 1.3.x which is supporting java 1.7 or later
Next Time You Require any dependency information just go to mvnrepository.com and just select the project and its version it will show complete dependency list over there
http://mvnrepository.com/artifact/org.springframework.data/spring-data-elasticsearch/1.0.0.RELEASE
Now Answer to Your Question.
No Spring Data ElasticSearch does not work with Spring 3.1.2 it Requires Minimum Spring 4.2.5 RELEASE

Resources