Springboot startup error: Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl required a bean of type

 

Description:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl 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)
Action:
Consider defining a bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplatein your configuration.
Process finished with exit code 1
Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl 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) Action: Consider defining a bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate’ in your configuration. Process finished with exit code 1
Field elasticsearchRestTemplate in cn.lili.modules.material.serviceImpl.QrMaterialServiceImpl 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)
Action:
Consider defining a bean of type org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate in your configuration.
Process finished with exit code 1

Solution:

Add lazy loading annotation: @Lazy

Read More: