有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Elasticsearch Shield抛出CreationException

我正在尝试建立一个运行服务,它使用Elasticsearch和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)

(stacktrace的格式很难看,请随意编辑以提高可读性)

如果我删除Elasticsearch Shield的Maven依赖项,那么服务将按预期启动,没有stacktraces,但由于排除了Shield,显然无法执行任何查询

如果您有任何帮助或意见,我们将不胜感激

编辑:我意识到错误是由Java客户机抛出的,而不是弹性本身


共 (0) 个答案