我正在尝试设置一个使用Elasticsearch with Shield的正在运行的服务。但是,当我尝试启动该服务时,我收到以下错误:
org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private java.util.List com.company.AppConfig.identConfigs;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'demoident' defined in URL [file:C:/path/to/config/foo.xml]:
Cannot resolve reference to bean 'bar_client' while setting bean property 'searchClients'
with key [TypedStringValue: value [default], target type [null]];
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'bar_client' defined in URL
[file:C:/path/to/config/foo.xml]: Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.company.ElasticSearchClient]:
Constructor threw exception; nested exception is
org.elasticsearch.common.inject.CreationException: Guice creation errors:
1) A binding to org.elasticsearch.shield.transport.filter.IPFilter was already configured
at _unknown_. at _unknown_
2) A binding to org.elasticsearch.shield.transport.ClientTransportFilter was already configured
at _unknown_. at _unknown_
3) A binding to org.elasticsearch.shield.ssl.ClientSSLService was already configured
at _unknown_. at _unknown_
4) A binding to org.elasticsearch.shield.ssl.ServerSSLService was already configured
at _unknown_. at _unknown_
4 errors
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
(对不起堆栈跟踪的丑陋格式,可以随意编辑以便于阅读)
如果我删除了Elasticsearch Shield的Maven依赖项,那么服务会按预期启动,没有堆栈跟踪,但显然因为排除了Shield而无法执行任何查询。
任何帮助或输入都将非常感激。
编辑:我意识到Java客户端抛出了错误,而不是Elastic本身。