1. 程式人生 > >redis.clients.jedis.exception.JedisConnectionException:Could not get a resource from the pool

redis.clients.jedis.exception.JedisConnectionException:Could not get a resource from the pool

class verbose 沒有 mage resource open conf bubuko uri

啟動項目報該異常。原因是因為該項目是需要啟動redis的,報錯原因是因為沒有安裝redis或者沒有手動啟動redis,把redis設置成自啟動就行了

一、下載windows版本的Redis

  • 官網下載地址:http://redis.io/download
  • github下載地址:https://github.com/MSOpenTech/redis/tags

二、安裝Redis

1.這裏下載的是Redis-x64-3.2.100版本,我的電腦是win7 64位,所以下載64位版本的,在運行中輸入cmd,然後把目錄指向解壓的Redis目錄。

技術分享圖片

2.啟動命令
redis-server redis.windows.conf

,出現下圖顯示表示啟動成功了。
技術分享圖片

三、設置Redis服務

1.由於上面雖然啟動了redis,但是只要一關閉cmd窗口,redis就會消失。所以要把redis設置成windows下的服務。
也就是設置到這裏,首先發現是沒用這個Redis服務的

技術分享圖片

2.redis-server --service-install redis.windows-service.conf --loglevel verbose

技術分享圖片

輸入命令之後沒有報錯,表示成功了,刷新服務,會看到多了一個redis服務。設置成自動就行了

技術分享圖片

redis.clients.jedis.exception.JedisConnectionException:Could not get a resource from the pool