Could not get a resource from the pool

来源:互联网 发布:以下商品禁止淘宝发布 编辑:程序博客网 时间:2024/05/21 11:31

最近封装了一个cache缓存工具包,今天redis报错:Could not get a resource from the pool

上网搜了很多资料,没找到比较有用的信息,后来发现原因如下:

刚开始我们的redis部署在内网,就没有设置密码,后来迁移到阿里云服务器,设置了密码。

if(StringUtils.isNotBlank(password)){  jedisPool = new JedisPool(config, redisHost, Integer.parseInt(redisPort),1000*60*5,password);}else{ jedisPool = new JedisPool(config, redisHost, Integer.parseInt(redisPort));}

同事在使用的时候,使用的是老的工具包,不包含带密码的初始化。


如果你也遇到整个问题,检查下自己的密码是否正确吧。



1 0