Jedis连接Redis报错: Could not get a resource from the pool
最近在网上copy了一份Redis工具类以及配置相关配置, junit一下报错Could not get a resource from the pool, 以下是配置。
开始找原因, 这里写几行代码作测试使用,如下
运行报错
意思是我的服务器上redis没有密码,但我代码中的配置文件里却设置了密码, 奥奥, 这样,
于是注释掉上图中spring.redis.password=123456
以及RedisConfig中的private String password
上的@Value
注解。
OK,成了!