Redis + Jedis + Spring Integration exception encountered

Source: Internet
Author: User

The cache is required for the project, and after comparison, Redis is selected, the client uses Jedis connections, and the Spring-data-redis is provided by spring. After the configuration is correct, start Tomcat and find the following exception:

caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' redistemplate ' Defined in class path resource [Spring.xml]: Initialization of Bean failed; Nested exception is java.lang.VerifyError:Bad type on operand stack

Exception Details:

Location:

Org/springframework/data/redis/connection/jedis/jedisconnectionfactory.afterpropertiesset () V @109:invokespecial

Reason:

Type ' Redis/clients/jedis/jedispoolconfig ' (current frame, stack[3]) was not assignable to ' org/apache/commons/pool2/ Impl/genericobjectpoolconfig '

Current Frame:

BCI: @109

Flags: {}

Locals: {' Org/springframework/data/redis/connection/jedis/jedisconnectionfactory '}

Stack: {' org/springframework/data/redis/connection/jedis/jedisconnectionfactory ', uninitialized, uninitialized , ' Redis/clients/jedis/jedispoolconfig ', ' java/lang/string ', Integer, Integer, ' java/lang/string '}

Bytecode:

0000000:2AB4 000d c700 3d2a bb00 1759 2ab4 0003

0000010:2AB4 0004 b700 18b5 000d 2ab4 0019 b800

0000020:1a99 000e 2ab4 000d 2ab4 0019 b600 1b2a

0000030:b400 059e 000e 2ab4 000d 2ab4 0005 b600

0000040:1C2A b400 0699 002e 2abb 001d 592a b400

0000050:0A2A b400 0db6 001e 2ab4 000d b600 1f2a

0000060:b400 0db6 0020 2ab4 000d b600 21b7 0022

0000070:b500 07B1

Stackmap Table:

Same_frame (@47)

Same_frame (@65)

Same_frame (@115)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:529)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:458)

At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:295)

At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:223)

At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:292)

At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:198)

At Org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource ( commonannotationbeanpostprocessor.java:442)

At Org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource ( commonannotationbeanpostprocessor.java:416)

At Org.springframework.context.annotation.commonannotationbeanpostprocessor$resourceelement.getresourcetoinject (commonannotationbeanpostprocessor.java:550)

At Org.springframework.beans.factory.annotation.injectionmetadata$injectedelement.inject (InjectionMetadata.java : 150)

At Org.springframework.beans.factory.annotation.InjectionMetadata.inject (injectionmetadata.java:87)

At Org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues ( commonannotationbeanpostprocessor.java:303)

... More

caused by:java.lang.VerifyError:Bad type on operand stack

Exception Details:

Location:

Org/springframework/data/redis/connection/jedis/jedisconnectionfactory.afterpropertiesset () V @109:invokespecial

Reason:

Type ' Redis/clients/jedis/jedispoolconfig ' (current frame, stack[3]) was not assignable to ' org/apache/commons/pool2/ Impl/genericobjectpoolconfig '

Current Frame:

BCI: @109

Flags: {}

Locals: {' Org/springframework/data/redis/connection/jedis/jedisconnectionfactory '}

Stack: {' org/springframework/data/redis/connection/jedis/jedisconnectionfactory ', uninitialized, uninitialized , ' Redis/clients/jedis/jedispoolconfig ', ' java/lang/string ', Integer, Integer, ' java/lang/string '}

Bytecode:

0000000:2AB4 000d c700 3d2a bb00 1759 2ab4 0003

0000010:2AB4 0004 b700 18b5 000d 2ab4 0019 b800

0000020:1a99 000e 2ab4 000d 2ab4 0019 b600 1b2a

0000030:b400 059e 000e 2ab4 000d 2ab4 0005 b600

0000040:1C2A b400 0699 002e 2abb 001d 592a b400

0000050:0A2A b400 0db6 001e 2ab4 000d b600 1f2a

0000060:b400 0db6 0020 2ab4 000d b600 21b7 0022

0000070:b500 07B1

Stackmap Table:

Same_frame (@47)

Same_frame (@65)

Same_frame (@115)

At Java.lang.Class.getDeclaredConstructors0 (Native Method)

At Java.lang.Class.privateGetDeclaredConstructors (class.java:2493)

At Java.lang.Class.getDeclaredConstructors (class.java:1901)

At Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors (autowiredannotationbeanpostprocessor.java:230)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors (abstractautowirecapablebeanfactory.java:972)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance ( abstractautowirecapablebeanfactory.java:945)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:487)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:458)

At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:295)

At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:223)

At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:292)

At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:194)

At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference ( beandefinitionvalueresolver.java:323)

At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary ( beandefinitionvalueresolver.java:107)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues ( abstractautowirecapablebeanfactory.java:1387)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1128)

At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:519)

... More

Very strange, because of Google's access restrictions, Baidu has no results for half a day, I know that Google can certainly, decisive fq search, did not let me down,

Google results Link: http://stackoverflow.com/questions/22704518/jedispoolconfig-is-not-assignable-to-genericobjectpoolconfig

The situation should be the jar package version issue, my current version is: Jedis-2.1.0.jar + Spring-data-redis-1.3.0.release.jar.

Follow the prompts and I'll upgrade the Jedis to Jedis-2.4.2.jar.

Run again, success!!

Ah, Baidu, do not do well

http://zhaobing315.iteye.com/blog/2082189

Redis + Jedis + Spring Integration exceptions encountered (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.