-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JestElasticsearchTemplate not able to do AutoWired. #148
Comments
Hi @sats17 , are you sure that you have exclude ElasticSearchAutoConfiguration like this :
And that at least this properties is set :
|
Hi @VanRoy, I did all what you mentioned,
As of now I can see that if I did like below, my project compiles without any error.
But if I swapped the positions or remove the ElasticsearchOperations, then spring boot not able to found bean for JestElasticsearchTemplate.
|
Hi @sats17, Indeed it's really strange 😄 . I will investigate on it. |
Hi @sats17 , thanks a lot for your additionnals informations. public class MyClass {
private final JestElasticsearchTemplate jestTemplate;
public MyClass(ElasticsearchOperations esTemplate) {
this.jestTemplate = (JestElasticsearchTemplate)esTemplate;
} I a futur release I will probably change the type of the Again, thanks for your help during the investigation. |
Hi @VanRoy , Thanks for the clarification 😃 |
Hi @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
com.github.vanroy
spring-boot-starter-data-jest
3.3.0.RELEASE
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
private ElasticsearchOperations template is pointing to JestElasticsearchTemplate class.
The text was updated successfully, but these errors were encountered: