大神求助sprinboot整合 elasticsearch

[复制链接]
查看11 | 回复2 | 2021-1-27 06:11:03 | 显示全部楼层 |阅读模式
以下是报错信息:
Description:
Anattemptwasmadetocallamethodthatdoesnotexist.Theattemptwasmadefromthefollowinglocation:
org.springframework.boot.autoconfigure.elasticsearch.rest.RestClientConfigurations$RestHighLevelClientConfiguration.elasticsearchRestHighLevelClient(RestClientConfigurations.java:75)
Thefollowingmethoddidnotexist:
org.elasticsearch.client.RestHighLevelClient.(Lorg/elasticsearch/client/RestClientBuilder;)V
Themethod'sclass,org.elasticsearch.client.RestHighLevelClient,isavailablefromthefollowinglocations:
jar:file:/Users/jianxiaowen/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/5.6.4/elasticsearch-rest-high-level-client-5.6.4.jar!/org/elasticsearch/client/RestHighLevelClient.class
Itwasloadedfromthefollowinglocation:
file:/Users/jianxiaowen/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/5.6.4/elasticsearch-rest-high-level-client-5.6.4.jar

Action:
Correcttheclasspathofyourapplicationsothatitcontainsasingle,compatibleversionoforg.elasticsearch.client.RestHighLevelClient


以下是pom文件,是springboot版本和这个es不兼容吗,原来用的es6.x是可以的,换成5.x就不行了,但是公司环境就要求5.x

4.0.0
com.xxx
repservice
1.0
kg-business
pom
repservice

org.springframework.boot
spring-boot-starter-parent
2.1.7.RELEASE


5.6.4
UTF-8
UTF-8
1.8


org.springframework.boot
spring-boot-starter-web

org.springframework.boot
spring-boot-starter-logging


org.springframework.boot
spring-boot-starter-log4j2

org.springframework.boot
spring-boot-configuration-processor
true

com.xxx.datanlp
graph-db-sdk
1.1-SNAPSHOT

mysql
mysql-connector-java
runtime

org.apache.commons
commons-lang3

commons-codec
commons-codec
1.13

org.springframework.data
spring-data-commons
2.1.10.RELEASE

org.projectlombok
lombok
true

org.springframework.boot
spring-boot-starter-test

org.springframework.boot
spring-boot-starter-logging

test

org.springframework.restdocs
spring-restdocs-mockmvc
test

org.springframework.boot
spring-boot-starter-jdbc

org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.0

org.mybatis.spring.boot
mybatis-spring-boot-starter-test
2.1.0
test

org.flywaydb
flyway-core
5.2.4

commons-fileupload
commons-fileupload
1.3.3

org.apache.httpcomponents
httpcore
4.4.12

org.apache.httpcomponents
httpclient
4.5.10

org.apache.httpcomponents
httpmime
4.5.10

io.reactivex.rxjava2
rxjava
2.2.9

org.springframework.boot
spring-boot-starter-aop

commons-net
commons-net
3.6

org.springframework.boot
spring-boot-starter-data-redis

redis.clients
jedis
2.9.0


org.apache.solr
solr-solrj
8.2.0


com.github.junrar
junrar
4.0.0


org.apache.ant
ant
1.10.7


com.jayway.jsonpath
json-path
2.4.0


com.alibaba
fastjson
1.2.51

com.arangodb
arangodb-java-driver
5.0.0


org.apache.logging.log4j
log4j-web
2.7

org.elasticsearch
elasticsearch
5.6.4

org.elasticsearch.client
elasticsearch-rest-client
5.6.4

org.elasticsearch.client
elasticsearch-rest-high-level-client
5.6.4



org.apache.maven.plugins
maven-surefire-plugin
true

org.springframework.boot
spring-boot-maven-plugin

org.apache.maven.plugins
maven-dependency-plugin


分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:11:03 | 显示全部楼层
你服务器版本是什么,服务器与客户端不匹配会有问题
回复

使用道具 举报

千问 | 2021-1-27 06:11:03 | 显示全部楼层
解决了
https://stackoverflow.com/questions/53610891/elasticsearch-java-client-initialization-fails/53663638#53663638
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行