php - spring + redis集群问题
PHP中文网
PHP中文网 2017-04-11 10:32:40
0
2
571

根据网上的教程用spring-data-redis整合,redis属性文件如下,
报错如下:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisDataSource': Unsatisfied dependency expressed through field 'shardedJedisPool'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'redis.clients.jedis.ShardedJedisPool' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1225)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552)

很好奇我并没有使用ShardedJedisPool分片池,为毛还是回去创建注入,求解,都是根据教程来的

PHP中文网
PHP中文网

认证高级PHP讲师

全部回复(2)
刘奇

idea的问题,编译的class文件没删除

Peter_Zhu

redis能在客户端访问吗?

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板