java-ee - redis java客户端不能创建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编译有八阿哥。
相关文章:
1. docker-compose 为何找不到配置文件?2. vim - docker中新的ubuntu12.04镜像,运行vi提示,找不到命名.3. 为什么我ping不通我的docker容器呢???4. mac连接阿里云docker集群,已经卡了2天了,求问?5. debian - docker依赖的aufs-tools源码哪里可以找到啊?6. docker网络端口映射,没有方便点的操作方法么?7. golang - 用IDE看docker源码时的小问题8. docker - 如何修改运行中容器的配置9. 关于docker下的nginx压力测试10. docker-machine添加一个已有的docker主机问题

网公网安备