Closed PikaLee closed 8 years ago
看代码肯定是不应该出这个问题的
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
public class JedisPoolConfig extends GenericObjectPoolConfig {
public JedisPoolConfig() {
// defaults to make your life with connection pool easier :)
setTestWhileIdle(true);
setMinEvictableIdleTimeMillis(60000);
setTimeBetweenEvictionRunsMillis(30000);
setNumTestsPerEvictionRun(-1);
}
}
你看看你的lib目录下面是不是有其他版本的jedis或者commons-pool2的jar?
jar版本如下 jodis 0.2.2版本 jedis 2.7.3 apache-common-pools2-2.3
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack Exception Details: Location: com/wandoulabs/jodis/RoundRobinJedisPool.resetPools()V @244: invokespecial Reason: Type 'redis/clients/jedis/JedisPoolConfig' (current frame, stack[5]) is not assignable to 'org/apache/commons/pool2/impl/GenericObjectPoolConfig' Current Frame: bci: @244 flags: { } locals: { 'com/wandoulabs/jodis/RoundRobinJedisPool', 'com/google/common/collect/ImmutableList', 'java/util/Map', 'com/google/common/collect/ImmutableList$Builder', 'java/util/Iterator', 'org/apache/curator/framework/recipes/cache/ChildData', 'com/wandoulabs/jodis/CodisProxyInfo', 'java/lang/String', 'com/wandoulabs/jodis/RoundRobinJedisPool$PooledObject', '[Ljava/lang/String;', 'java/lang/String', integer } stack: { uninitialized 206, uninitialized 206, 'java/lang/String', uninitialized 212, uninitialized 212, 'redis/clients/jedis/JedisPoolConfig', 'java/lang/String', integer, integer, integer, 'java/lang/String', integer, 'java/lang/String' }