1. 程式人生 > >redis報錯Could not get a resource from the pool問題的解決

redis報錯Could not get a resource from the pool問題的解決

概述

上線了一個新專案,結果報錯:

redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool
        at redis.clients.util.Pool.getResource(Pool.java:51)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)
        ......
Caused by: java.util.NoSuchElementException: Unable to validate object
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:495
) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:362) at redis.clients.util.Pool.getResource(Pool.java:49)

解決

發現是redis的密碼忘了寫到配置檔案中

總結

上線新專案,一定要核對配置資訊是否全、是否正確