- elasticsearch 5.4.
- Spring boot 1.4.7.RELEASE
- spring-data-elasticsearch 3.0.1.RELEASE.
@Configuration
@EnableElasticsearchRepositories(basePackages = "com.landfiles.farms.repository")
public class ESConfig {
@Value("${elasticsearch) .host}")
частная строка EsHost;
@Value("${elasticsearch.port}")
частное целое число EsPort;
@Bean
public Client client() выдает исключение {
return new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new InetSocketTransportAddress(
InetAddress.getByName(EsHost) ), EsPort));
@Bean
public ElasticsearchOperations elasticsearchTemplate() выдает исключение {
return new ElasticsearchTemplate(client());
Код: Выделить всё
java.lang.NoClassDefFoundError: org/springframework/data/mapping/model/Property
Код: Выделить всё
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'elasticsearchTemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'elasticsearchTemplate' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'elasticsearchConverter' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]: Unsatisfied dependency expressed through method 'elasticsearchConverter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingContext' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/mapping/model/Property
У кого-нибудь есть работающий пример hello world?
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/475 ... chtemplate