Elasticsearch Field x in x required a bean named ‘elasticsearchTemplate‘ that could not be found问题解决
问题描述:FielduserRepositoryincom.controller.ElasticsearchControllerrequiredabeannamed'elasticsearchTemplate'thatcouldnotbefound.问题分析:1、userRepository实例化的时候用到了elasticsearchTemplate,但是elasticsearchTemplate
·
问题描述:
Field userRepository in com.controller.ElasticsearchController required a bean named 'elasticsearchTemplate' that could not be found.
问题分析:
1、userRepository实例化的时候用到了elasticsearchTemplate,但是elasticsearchTemplate没有实例化。
解决办法:创建Elasticsearch配置类,在配置类中实例化ElasticsearchTemplate。具体做法请查看以下博客。
更多推荐
已为社区贡献20条内容
所有评论(0)