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等是否正確
重新啓動就可以了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章