JestElasticsearchTemplate not able to do AutoWired.
See original GitHub issueHi @VanRoy , I tried to autowire the JestElasticsearchTemplate and it is returning below error.
Action: Consider defining a bean of type ‘com.github.vanroy.springdata.jest.JestElasticsearchTemplate’ in your configuration.
for code
@Service public class ElasticSearchService { @Autowired private JestElasticsearchTemplate template; }
and dependency I am using is <dependency> <groupId>com.github.vanroy</groupId> <artifactId>spring-boot-starter-data-jest</artifactId> <version>3.3.0.RELEASE</version> </dependency> After checking all beans that is created in my application I did not found any bean for JestElasticsearchTemplate. But I see bean for elasticsearchTemplate is created.
Also when I am not getting any exception when I am autowiring an interface
@Autowired private ElasticsearchOperations template;
and after the getting class of above template class variable I can see it is pointing to JestElasticsearchTemplate class, but again after this I checked all beans which is created in Container I did not found JestElasticsearchTemplate bean is created.
It all looks strange to me as
- Error is throwing for JestElasticsearchTemplate while performing autowiring on that.
- How in my container I did not found any bean name as JestElasticsearchTemplate.
- And even if there is not any bean created in my container how @Autowired private ElasticsearchOperations template is pointing to JestElasticsearchTemplate class.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Hi @sats17, Indeed it’s really strange 😄 . I will investigate on it.
Hi @VanRoy ,
Thanks for the clarification 😃