jedis java.lang.verifyerror_jedis,spring-redis-data 整合使用,版本问题异常以及解决。

最近整合使用redis spring-redis 出现了一下问题

spring:3.2.4.RELEASE

jedis: jedis  2.4.2

spring-data-redis: 1.5.2.RELEASE

各种折腾换了N个版本之后,启动的时候报错主要有一下两种:

Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.isUserLevelMethod(Ljava/lang/reflect/Method;)Z

java.lang.VerifyError: Bad type on operand stack

Exception Details:

Location:

org/springframework/data/redis/connection/jedis/JedisConnectionFactory.afterPropertiesSet()V

最后得到如下配置是OK的:

redis.clients

jedis

2.4.2

org.springframework.data

spring-data-redis

1.3.0.RELEASE

org.springframework

spring-xxx

3.2.4.RELEASE

版本问题解决了,先贴各项配置代码:

spring:

注入:

@Autowiredprivate RedisTemplate redisTemplate;

使用:

String paramK = "spring-redis-key";

String paramV="Hello,spring-redis-data!!!";

redisTemplate.opsForValue().set(paramK, paramV);

存值成功之后,存的值为:

this ok.

在 redis-cli中查看值结果如下:

get spring-redis-key"\xac\xed\x00\x05t\x00\bthis ok."

发现没,多了一个前缀    \xac\xed\x00\x05t\x00\b

这个为序列化的问题:http://blog.csdn.net/yunhaibin/article/details/9001198

参考资料:

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

http://www.cnblogs.com/tankaixiong/p/3660075.html

http://www.sxt.cn/u/2839/blog/4363

http://www.cnblogs.com/tankaixiong/p/3660075.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值