An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.hibernate.search.elasticsearch.client.impl.DefaultElasticsearchClientFactory.createClient(DefaultElasticsearchClientFactory.java:92)
The following method did not exist:
org.elasticsearch.client.RestClientBuilder.setMaxRetryTimeoutMillis(I)Lorg/elasticsearch/client/RestClientBuilder;
The method's class, org.elasticsearch.client.RestClientBuilder, is available from the following locations:
jar:file:/home/temp/.gradle/caches/modules-2/files-2.1/org.elasticsearch.client/elasticsearch-rest-client/7.10.2/d0c857275bcec532079cdabb7913e2611c123e70/elasticsearch-rest-client-7.10.2.jar!/org/elasticsearch/client/RestClientBuilder.class
The class hierarchy was loaded from the following locations:
org.elasticsearch.client.RestClientBuilder:
file:/home/temp/.gradle/caches/modules-2/files-2.1/org.elasticsearch.client/elasticsearch-rest-client/7.10.2/d0c857275bcec532079cdabb7913e2611c123e70/elasticsearch-rest-client-7.10.2.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.RestClientBuilder* 我们需要使用elasticsearch版本7.10.2,目前我们使用的是springboot版本2.3.9
有什么帮助吗?
这是application.yaml文件中弹性搜索7.10.2的正确映射吗?
hibernate:
format_sql: true
search.default:
elasticsearch:
dynamic_mapping: true
index_schema_management_strategy: update
required_index_status: yellow发布于 2022-02-17 16:35:51
elasticsearch-rest-client依赖项( Elasticsearch的低级REST客户端)的版本不必与您实际使用的Elasticsearch服务器版本相匹配。elasticsearch-rest-client 7.16.3将很好地与Elasticsearch服务器7.10.2对话。如果你担心的话,elasticsearch-rest-client 7.16.3是在ASL2.0下授权的。
因此,简而言之:执行Hibernate搜索文档的建议,并升级到最新版本的elasticsearch-rest-client。请参见https://docs.jboss.org/hibernate/search/6.1/reference/en-US/html_single/#gettingstarted-framework-spring-boot-dependency-versions:
Spring在您不知情的情况下自动设置依赖项的版本。虽然这通常是一件好事,但Spring依赖关系有时会有点过时。因此,建议至少对一些关键依赖项覆盖Spring的默认值。
使用Maven,将其添加到POM中:
5.6.5.Final 7.16.3
如果你使用Elasticsearch的高级REST客户端,现在.你在泡菜里。该客户端不再是开源的,并可能导致许可问题。而且它的最后一个开源版本(7.10)可能不适用于elasticsearch-rest-client 7.16.3。因此,如果您确实需要使用高级别REST客户端的7.10或更早版本,那么您将需要使用较早版本的elasticsearch-rest-client和Hibernate搜索。
https://stackoverflow.com/questions/71161670
复制相似问题