Hi,
since the update to Elasticsearch 7.16. I'm getting a java.lang.NoSuchFieldError: INDEX_CONTENT_TYPE when running a Unit Test that executes a save/saveAll() statement with Test containers.
On 7.15 everything works just fine. Unfortunately I'm now forced to use 7.16 and can't just switch to any other version.
Here is an example project of the setup:
It seems that the class for which the field could not be found is all right. It's the "Requests" class from Elasticsearch and the INDEX_CONTENT_TYPE field is public, static.
I ran the test with -verbose:class and the Requests-class is loaded only one time, so it shouldn't be overshadowed by another dependency.
It however works when I just normally run the application. Does that mean the container test setup is somehow influencing the class loading process?
Does anyone have an idea what the issue is, or how I could further debug that error?
Ah I reread your post and now I'm getting it. You might be right with this. However during the debug session I only had one Elasticssearch dependency in my class path which was the 7.16 one. Also the -verbose:class logs only indicated that only one Elasticsearch version was loaded.
Also it's kind of strange that downgrading it to 7.15 worked again. If my current elastic-search-data would have overshadow the maven defined version, I would expect 7.15 to break as well.
Aside from that I unfortunately am forced to use the 7.16 version, there is however no spring-data version out there yet that uses org.Elasticsearch.client:7.16.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.