Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/ConnectionPoolConfig
时间: 2023-12-13 12:43:25 浏览: 177
Tess, if broken it is fix it you should
引用\[1\]:Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.UnifiedJedis at java.net.URLClassLoader$1.run(URLClassLoader.java:372) ~\[na:1.8.0_20\] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~\[na:1.8.0_20\] at java.security.AccessController.doPrivileged(Native Method) ~\[na:1.8.0_20\] at java.net.URLClassLoader.findClass(URLClassLoader.java:360) ~\[na:1.8.0_20\] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~\[na:1.8.0_20\] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~\[na:1.8.0_20\] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~\[na:1.8.0_20\] ... 56 common frames omitted 引用\[2\]:只要将redis启动器中的lettuce排除在外,注意版本号不要写,默认会继承父项目的版本号以防jar包冲突。 <!-- redis启动器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <exclusions> <exclusion> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> </exclusion> </exclusions> </dependency> <!-- jedis连接池--> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> 引用\[3\]:在pom中导入jetcache坐标中的redis与springboot版本冲突导致, <dependency> <groupId>com.alicp.jetcache</groupId> <artifactId>jetcache-starter-redis</artifactId> <version>2.7.0.M1</version> <!--这里版本不唯一,也可能是别的版本--> </dependency> 解决方法: 问题:Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/ConnectionPoolConfig
回答: 这个错误是由于缺少redis.clients.jedis.ConnectionPoolConfig类引起的。根据引用\[1\],可能是由于缺少redis.clients.jedis.UnifiedJedis类导致的。解决这个问题的方法有两种。一种是根据引用\[2\],在项目的pom文件中排除lettuce-core依赖,然后添加jedis依赖。另一种是根据引用\[3\],检查项目中的redis和springboot版本是否冲突,如果有冲突,可以尝试升级或降级其中一个版本以解决冲突。
#### 引用[.reference_title]
- *1* *3* [【Spring常见错误】java.lang.NoClassDefFoundError: redis/clients/jedis/UnifiedJedis](https://blog.csdn.net/qq_52360069/article/details/125275138)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [springboot整合redis中 出现Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/util/Pool](https://blog.csdn.net/qq_45059663/article/details/113608498)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文