提问:布和纸怕什么?

Spring-Data-Elasticsearch 在web项目中使用问题

Elasticsearch | 作者 gangajun | 发布于2017年03月28日 | 阅读数:5753

http://docs.spring.io/spring-d ... ation
中提到Elasticsearch Repositories有三种配置方式:
1.spring 命名空间
2.使用注解
3.使用CDI
我在网上看到很多demo都是使用的第一种方式
配置为<elasticsearch:repositories base-package="**.**.respository" />

<elasticsearch:transport-client id="client"
cluster-nodes="localhost:9300" />

<bean name="elasticsearchTemplate"
class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="client" />
</bean>

但是在运行时一直报错nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookRepository': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:

感觉很奇怪,程序找不到bookRepository这个bean
明明已经加到spring的配置文件中了,可就是不行,
这是为什么
已邀请:

hailang

赞同来自:

spring 扫描是什么范围
commpoment-scan这个

要回复问题请先登录注册