springboot 解决 NoClassDefFoundError: redis/clients/jedis/util/SafeEncoder
这个问题纯粹是版本不兼容问题,是因为 spring-data-redis 与 jedis 的版本不兼容造成的,一般使用jedis时会出现类似问题,特别是使用jedis进行多redis数据源自定义配置时容易出现。
解决办法:
步骤一:首先查看你所依赖的 spring-data-redis 版本,如果是springboot则依赖spring-boot-starter-data-redis,其内部包含了 spring-data-redis,查看其具体版本。
如图所示,可以看到我所依赖的 spring-boot-starter-data-redis 版本是 2.0.9.RELEASE,而其内部依赖的 spring-data-redis 版本是 2.5.1
步骤二:根据查处的 spring-data-redis 版本,去maven中心仓库查看其对应的jedis版本。
在此页面中总全局搜索jedis即可
可以看到对应的jedis版本应该为3.6.0,接下来修改pom文件中的jedis版本为对应版本即可,别忘了清下maven缓存再重启springboot。
最后贴上博主自己的pom配置:
<!-- redis 缓存操作 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId><version>2.0.9.RELEASE</version><exclusions><!-- 不依赖Redis的异步客户端lettuce --><exclusion><groupId>io.lettuce</groupId><artifactId>lettuce-core</artifactId></exclusion></exclusions></dependency><!-- Redis的异步客户端jedis --><dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId><version>3.6.0</version></dependency>
springboot 解决 NoClassDefFoundError: redis/clients/jedis/util/SafeEncoder相关推荐
- 【日常Exception】第二十四回:nested exception is java.lang.NoClassDefFoundError: redis/clients/jedis/util/Pool
热门系列: 程序人生,精彩抢先看 日常异常,是否也有你似曾相识的那一个 1.问题 近期遇到的一个异常问题如题所示,下面是完整的异常内容,原景重现: PropertyAccessException 1: ...
- SpringBoot: redis/clients/jedis/util/SafeEncoder
缺少jedis依赖 <dependency><groupId>redis.clients</groupId><artifactId>jedis</ ...
- 解决:redis.clients.jedis.exceptions.JedisDataExceptionERR This instance has cluster support disabled
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. springCloud 项目启动工程,redis 集群连接报错: Caused by: red ...
- springboot报错:Could not get a resource from the pool redis.clients.jedis.exceptions.JedisConnection
运行项目时报错: 2022-04-15 19:27:54.052 ERROR 9676 --- [nio-8181-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServl ...
- SpringBoot 整合Redis报错:NoClassDefFoundError: redis/clients/util/SafeEncoder
QUESTION:SpringBoot 整合Redis报错:NoClassDefFoundError: redis/clients/util/SafeEncoder? ANSWER: 这种情况是版本不 ...
- Caused by: java.lang.NoClassDefFoundError: redis/clients/util/Pool
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- 解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro
引出问题 当前Redis配置项 测压环境 出现的问题: redis.clients.jedis.exceptions.JedisConnectionException: Attempting to r ...
- 【已解决】Exception in thread “Thread-0“ redis.clients.jedis.exceptions.JedisConnectionException: java.n
问题: Exception in thread "Thread-0" redis.clients.jedis.exceptions.JedisConnectionException ...
- 解决:Caused by: redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 报错: Caused by: redis.clients.jedis.exceptions.J ...
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值. <bean id="dataJedisPoolConfig" class=" ...
最新文章
- 和linux关系_Linux内核Page Cache和Buffer Cache关系及演化历史
- iOS一个灵活可扩展的开源Log库
- pyinstaller打包pyqt文件(转)
- Atomic原子类常用方法总结(包含四大类型)
- Flutter入门:Offstage和Visibility
- vue学习之路.02
- 【九】Git 可视化GUI管理工具 - SourceTree
- byte[]和string
- 计算机四级网络工程师考点速查,计算机四级《网络工程师》考点习题
- 浏览器汇总介绍--Opera
- 20200710每日一句
- 一个黑客的基本素养——社会工程学
- 小游戏开发引擎CocosCreator
- QoS实现交换机带宽控制
- “JSON parse error: Unexpected character (‘\“‘ (code 34)): was expecting comma to separate Object ent
- Hustoj 添加管理员 删除用户
- 基于Opencv的开源的中文车牌识别系统
- 打开GTA 5竟要跑19.8亿次if语句!黑客嘲讽R星代码烂,修改后直接省70%加载时间
- 不等号属于不等式吗_什么是不等式
- Oracle 错误总结及解决方法