成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

java-ee - redis java客戶端不能創(chuàng)建JedisPool

瀏覽:63日期:2023-08-25 08:19:06

問(wèn)題描述

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總是報(bào)錯(cuò),鼠標(biāo)移到小紅叉上提示:

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

問(wèn)題解答

回答1:

沒(méi)錯(cuò),commons-pool這個(gè)依賴(lài)包必須添加上,否則代碼是對(duì)的也報(bào)錯(cuò)

回答2:

原來(lái)是忘記添加GenericObjectPool的基本包c(diǎn)ommons-pool

回答3:

更新redis client;低版本的redis clien在Jave8編譯有八阿哥。

標(biāo)簽: java
相關(guān)文章: