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$Config jedis.jar的版本是2.1.0
沒錯,commons-pool這個依賴套件必須加上,否則程式碼是對的也報錯
原來是忘記加入GenericObjectPool的基本套件commons-pool
更新redis client;低版的redis clien在Jave8編譯有八阿哥。