java-ee - redis java客戶端不能創(chuàng)建JedisPool
問題描述
JedisPoolConfig config = new JedisPoolConfig(); config.setMaxActive(100);config.setMaxIdle(20);config.setMaxWait(1000l);config.setTestOnBorrow(true);JedisPool jedisPool= new JedisPool(config, 'localhost');
JedisPool jedisPool= new JedisPool(config, 'localhost');這句Eclipse總是報錯,鼠標移到小紅叉上提示:
Multiple markers at this line- The type org.apache.commons.pool.impl.GenericObjectPool$Config cannot be resolved. It is indirectly referenced from required .class files- The constructor JedisPool(GenericObjectPool$Config, String) refers to the missing type GenericObjectPool$Configjedis.jar的版本是2.1.0
問題解答
回答1:沒錯,commons-pool這個依賴包必須添加上,否則代碼是對的也報錯
回答2:原來是忘記添加GenericObjectPool的基本包commons-pool
回答3:更新redis client;低版本的redis clien在Jave8編譯有八阿哥。
相關(guān)文章:
1. docker - 如何修改運行中容器的配置2. nignx - docker內(nèi)nginx 80端口被占用3. python3.x - python連oanda的模擬交易api獲取json問題第五問4. java - SSH框架中寫分頁時service層中不能注入分頁類5. 為什么我ping不通我的docker容器呢???6. 關(guān)于docker下的nginx壓力測試7. 域名解析在Ubuntu64 9.04計算機上的Java應(yīng)用程序中不起作用所有其他軟件可以正確解析DNS8. javascript - js代碼獲取驗證碼倒計時問題9. docker-machine添加一個已有的docker主機問題10. angular.js - angular內(nèi)容過長展開收起效果
