您当前的位置: 首页 >  redis

一一哥Sun

暂无认证

  • 5浏览

    0关注

    622博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set([B[B)V异常处理办法

一一哥Sun 发布时间:2019-07-22 13:44:54 ,浏览量:5

NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set([B[B)V异常处理办法 一. 异常描述

在将我的Spring boot项目版本升到2.0.3,集成了Spring Security OAuth2(默认版本),redis(默认版本),并且用redis来存储token,项目正常启动后,请求token时报错:

nested exception is java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set([B[B)V

这个错误是因为版本问题,Spring-data-redis 2.0版本中set(String,String)方法被弃用了.

二. 解决办法

在spring-cloud-starter-security中排除默认的spring-security-oauth2依赖,然后添加2.3.3.RELEASE新版本的spring-security-oauth2依赖.


   
      org.springframework.cloud
      spring-cloud-starter-security
      
         
         
            spring-security-oauth2
org.springframework.security.oauth
         
      
    

    
       org.springframework.security.oauth
       spring-security-oauth2
       2.3.3.RELEASE

 

关注
打赏
1665624836
查看更多评论
立即登录/注册

微信扫码登录

0.0946s