I am trying to use Jest 0.0.6 ElasticSearch client with SpringBoot 1.4 and have the following error. I think it's due to the fact that SpringBoot tries to create a Jest Client automatically along with a health check for it, but the old Jest client does not have some of the required classes.
Any ideas how to get round this?
I need to connect to an old ElasticSearch v0.90.5 server which I have no option to upgrade at this moment. If you have any ideas on how best to connect to such an old version from SpringBoot that would also be very helpful.
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
From the Spring Boot 1.4 release notes:
"Jest support
Spring Boot auto-configures a JestClient and a dedicated HealthIndicator if Jest is on the classpath. This allows you to use Elasticsearch even when spring-data-elasticsearch isn’t on the classpath."