Java Spring Boot2.0 连接 Redis 出错:Unsatisfied dependency expressed through field 'redisRepository'

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisController': Unsatisfied dependency expressed through field 'redisRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisRepositoryImpl' defined in file [F:JavaWorkSpaceAlibaba2018AlibabaJavaSpringBoot2x10RedisDemotargetclassescomfrankxuleirepositoryRedisRepositoryImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTemplate' defined in class path resource [com/frankxulei/config/RedisConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.core.RedisTemplate]: Factory method 'redisTemplate' threw exception; nested exception is 。。。
解决办法:
1、检查一下Redis服务器是否启动
2、检查一下Spring Boot的Redis配置参数Host、Port
3、Password等是否正确
重新启动就可以了

上一篇:Linux 3.文件查看命令


下一篇:网络编程基础-Socket编程(使用socketserver实现一对多通信)