1
votes

I'm making use of the spring elasticsearch data to create document, index and also to perform query related operations. I'm using the latest spring-data-elasticsearch=4.1.0-SNAPSHOT and Elastic restclient and transport client version = 7.6.2 as per the document specified by spring elasticsearch data. But i'm getting the below mentioned error

Caused by: java.lang.NoClassDefFoundError: org/springframework/data/elasticsearch/core/EntityMapper
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3167)
    at java.base/java.lang.Class.getDeclaredMethods(Class.java:2310)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463)
    ... 21 common frames omitted

I looked upto into the docs - https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.mapping.meta-model where they're telling that EntityMapper has been removed from 4.0.X. Then why this issue is occurring. Can you guys please help in resolving this issue. It's a blocker for me.

1
Are you using Spring Boot? If so, which version?P.J.Meisch
Yes, i'm using spring boot version 2.2.6? i think this might be problem i guesscoders
I saw the ElasticsearchDataConfiguration code in version 2.2.6 has EnityMapper bean.. May be i will try to update the spring boot version and check this outcoders

1 Answers

2
votes

As per the mentioned reference, EntityMapper has been removed from version 4.0.X.

And you are using 4.1.0 - spring-data-elasticsearch=4.1.0-SNAPSHOT

Hence the issue occurred.

Refer this section - Removal of the used Jackson Mapper

I checked the dependencies:

Refer older version - 3.1.9 - It has EntityMapper

Refer 4.1.0 - EntityMapper is not there - it's removed.