SpringBoot 1.4 で Jest 0.0.6 ElasticSearch クライアントを使用しようとしていますが、次のエラーが発生します。これは、SpringBoot が Jest クライアントをヘルス チェックとともに自動的に作成しようとするためだと思いますが、古い Jest クライアントには必要なクラスの一部がありません。
これを回避する方法はありますか?
現時点でアップグレードするオプションがない古い ElasticSearch v0.90.5 サーバーに接続する必要があります。SpringBoot からそのような古いバージョンに接続する最善の方法について何かアイデアがあれば、それも非常に役立ちます。
Caused by:org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'metricsEndpointMetricReader' defined in class path resource
...
[org/springframework/boot/actuate/autoconfigure/ElasticsearchHealthIndicatorConfiguration$ElasticsearchJestHealthIndicatorConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicator]:
Factory method 'elasticsearchHealthIndicator' threw exception; nested exception is java.lang.NoClassDefFoundError: io/searchbox/action/Action; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration ': Bean instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$$EnhancerBySpringCGLIB$$909d8b5d]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'elasticsearchHealthIndicator' defined in class path resource [org/springframework/boot/actuate/autoconfigure/ElasticsearchHealthIndicatorConfiguration$ElasticsearchJestHealthIndicatorConfiguration.class]: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicator]: Factory method 'elasticsearchHealthIndicator' threw exception; nested exception is java.lang.NoClassDefFoundError: io/searchbox/action/Action
Spring Boot 1.4 リリースノートから:
「冗談のサポート
Jest がクラスパス上にある場合、Spring Boot は JestClient と専用の HealthIndicator を自動構成します。これにより、spring-data-elasticsearch がクラスパスにない場合でも、Elasticsearch を使用できます。」