首页 > Web > tomcat > 正文

tomcat整合redis 因Jedis版本不一致遇到的异常
2017-03-22 15:01:31 点击:

报错信息:Caused by: org springframework beans factory BeanCreationException: Error creating bean with name & 39;redisTemp
最近使用tomcat整合redis来保存session,启动tomcat时报错信息:




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]) is 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 73, uninitialized 73, '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)...



原因:jedis版本不一致导致。

解决方法:更换tomcat/lib目录下jedis版本和项目目录下的jedis版本。

附件,常用版本下载:http://mirror.cnop.net/jedis/



相关热词搜索:版本 tomcat redis

上一篇:tomcat安装云锁 防护模块
下一篇:tomcat 项目 图片验证码显示不出 Could not initialize class sun.font.Fo