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

原文链接:https://www.cnblogs.com/Cindy_weiwei/p/11975554.html

 

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)

 

诡异的是,在MyEclipse里运行一定会出这个问题,但是项目打包成jar在外部运行是没这个问题的。

 

当时找了很久的答案,包括国外的网站都去看过了,一般都是说spring、jedis、和commons-pool2的版本配合问题。

然而折腾了很久觉得还真不是,因为试了很多版本都不对。

然后怒而改代码,发现无法拉起,于是考虑jar包的加载顺序问题。

用的是Spring 3.1.4版本,Jedis 2.9版本, commons-pool2 2.6.0版本。

在Order and Export里,将Jedis和commons-pool2放在spring一系列的jar包之前,编译,启动,错误消失,问题解决

-------------------------------------------------------------------

我遇到的问题

项目是复制的,用的maven加载的包和外部导入的包,一直报这个错,搞不明白,看了上面这篇帖子,将maven加载的jar包和自己外部导入的全部清除,重新加载再运行就可以了

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值