Spring boot, mybatis,Redis Scheduler一起使用时出错 #422

Open
Xinghan opened this Issue Dec 14, 2016 · 1 comment

Projects

None yet

2 participants

@Xinghan
Xinghan commented Dec 14, 2016

版本用的是0.5.3,并且尝试了自己编译源码,还是一样的错误。
在创建redisscheduler时候会报以下错误:
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool$Config
at com.scientistin.spider.BaiduPaperSpider.crawl(BaiduPaperSpider.java:50)
at com.scientistin.SinspiderApplication.run(SinspiderApplication.java:37)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:784)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:771)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.scientistin.SinspiderApplication.main(SinspiderApplication.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.pool.impl.GenericObjectPool$Config
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 9 common frames omitted

Jedis 使用了commons.pool2,不知道哪里冲突了

spring boot版本:1.4.2.RELEASE
mybatis版本:mybatis-spring-boot-starter:1.1.1

@code4craft
Owner
code4craft commented Dec 15, 2016 edited

看起来是Jedis依赖的commons.pool导致的,升级Jedis到2.9.0重新编译一下试试?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment