[Solved] Jedis:Exception in thread “main” java.lang.VerifyError: Bad type on operand stack

Exception in thread “main” java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/test/tools/jedis/JedisTools.init()V @117: invokespecial
Reason:
Type ‘redis/clients/jedis/JedisPoolConfig’ (current frame, stack[2]) is not assignable to ‘org/apache/commons/pool2/impl/GenericObjectPoolConfig’
Current Frame:
bci: @117
flags: { }
locals: { ‘com/test/tools/jedis/JedisTools’, ‘redis/clients/jedis/JedisPoolConfig’, ‘java/lang/String’ }
stack: { uninitialized 90, uninitialized 90, ‘redis/clients/jedis/JedisPoolConfig’, ‘java/lang/String’, integer, integer, ‘java/lang/String’ }
Bytecode:
0x0000000: bb00 2859 b700 2a4c 2b2a b400 1db6 002b
0x0000010: b600 312b 2ab4 001d b600 35b6 0038 2b2a
0x0000020: b400 1db6 003b 85b6 003f 2b2a b400 1db6
0x0000030: 0043 b600 462b 2ab4 001d b600 4ab6 004d
0x0000040: 2ab4 001d b600 504d 2cc6 000f 1254 2cb6
0x0000050: 0056 b600 5b99 0005 014d bb00 5f59 2b2a
0x0000060: b400 1db6 0061 2ab4 001d b600 642a b400
0x0000070: 1db6 0067 2cb7 006a b300 16b1
Stackmap Table:
append_frame(@88,Object[#40],Object[#87])
same_frame(@90)

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:962)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:935)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.test.dataprocess.Application.main(Application.java:44)

The weird thing is, running in MyEclipse will definitely come out of this problem, but the project is packaged into a jar to run in the external is no such problem.

At that time, I searched for a long time for the answer, including foreign sites have gone to see, generally said spring, jedis, and commons-pool2 version with the problem.

However, tossed a long time think it really is not, because tried many versions are not right.

Then I modified the code and found that I could not pull up, so I considered the loading order of jar packages.

I used Spring 3.1.4, Jedis 2.9 and commons-pool2 2.6.0.

In Order and Export, put Jedis and commons-pool2 before a series of jar packages of spring, compile, start, the error disappears, problem solved

Similar Posts: