ES报错The following candidates were found but could not be injected
创始人
2025-01-08 18:37:29
0

遇到的问题

The following candidates were found but could not be injected:
- Bean method ‘elasticsearchTemplate’ in ‘ElasticsearchDataConfiguration.RestClientConfiguration’ not loaded because @ConditionalOnMissingBean (names: elasticsearchTemplate types: org.springframework.data.elasticsearch.core.ElasticsearchOperations; SearchStrategy: all) found beans of type ‘org.springframework.data.elasticsearch.core.ElasticsearchOperations’ elasticsearchTemplate and found beans named elasticsearchTemplate

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2024-02-19 20:11:04.894 ERROR 31172 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field elasticsearchRestTemplate in cn.yiyuan.gift.service.impl.GiftSearchServiceImpl required a bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate’ that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

The following candidates were found but could not be injected:
- Bean method ‘elasticsearchTemplate’ in ‘ElasticsearchDataConfiguration.RestClientConfiguration’ not loaded because @ConditionalOnMissingBean (names: elasticsearchTemplate types: org.springframework.data.elasticsearch.core.ElasticsearchOperations; SearchStrategy: all) found beans of type ‘org.springframework.data.elasticsearch.core.ElasticsearchOperations’ elasticsearchTemplate and found beans named elasticsearchTemplate

Action:
Consider revisiting the entries above or defining a bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate’ in your configuration.
Process finished with exit code 1
解决
注入的es不匹配
@Autowired
private ElasticsearchRestTemplate elasticsearchRestTemplate;
修改为正确的
@Autowired
private ElasticsearchTemplate elasticsearchRestTemplate;
问题完美解决,希望可以帮到你

相关内容

热门资讯

黑科技辅助"aapo... 黑科技辅助"aapoker辅助软件开发机制"wpk透视辅助(都是是真的有挂)-哔哩哔哩;1、实时aa...
黑科技能赢(德州ai机器人)外... 黑科技能赢(德州ai机器人)外挂透明挂辅助神器(透视)竟然是真的有挂(黑科技方法)-哔哩哔哩1、操作...
黑科技中牌率!wepokewo... 黑科技中牌率!wepokewopoker透明挂(透视)太坑了存在有挂(科技教程黑科技教程)-哔哩哔哩...
黑科技ai代打(Wpk)有辅助... 黑科技ai代打(Wpk)有辅助挂吗(透视)线上德州ai打法(果然是有挂);最新版2024是一款经典耐...
黑科技真的"wpk辅... 黑科技真的"wpk辅助器安装"德州之星辅助器怎么用(一直有挂)-哔哩哔哩一、德州之星辅助器怎么用软件...
黑科技挂(德扑ai智能机器人)... 黑科技挂(德扑ai智能机器人)外挂透明挂辅助神器(透视)竟然真的是有挂(黑科技解密)-哔哩哔哩;黑科...
黑科技教学!德州之星有辅助挂吗... 黑科技教学!德州之星有辅助挂吗(透视)太坑了存在有挂(介绍教程黑科技方法)-哔哩哔哩1、德州之星有辅...
黑科技ai代打(AAPoKER... 黑科技ai代打(AAPoKER)职业代打(透视)辅助软件(本然有挂)1、不需要AI权限,帮助你快速的...
黑科技好友房"aa扑... 黑科技好友房"aa扑克有外挂吗"wpk德州扑克(本来是有挂)-哔哩哔哩1、每一步都需要思考,不同水平...
黑科技好友!德州aiapp(黑... 黑科技好友!德州aiapp(黑科技)太坑了存在有挂(专业教程黑科技规律)-哔哩哔哩1、超多福利:超高...