jedis : NoSuchMethodError: org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier

2023-10-17 14:01:47
警告: Exception encountered during context initialization - cancelling refresh attempt:
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined
 in class path resource [applicationContext-redis.xml]: Bean instantiation via constructor failed; 
 nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
 [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Constructor threw exception;
 nested exception is java.lang.NoSuchMethodError: 
    org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier;)V
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'connectionFactory' defined in class path resource [applicationContext-redis.xml]:
 Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException:
 Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: 
 Constructor threw exception; nested exception is java.lang.NoSuchMethodError: 
 org.springframework.util.Assert.isTrue(ZLjava/util/function/Supplier;)V

当前jar版本

jedis 2.9

spring-data-redis 2.0.5

原因发现是spring-data-redis 版本过高 降低到1.7.2 可以正常运行


  • 作者:琅琊山二当家
  • 原文链接:https://blog.csdn.net/AlbertFly/article/details/79458583
    更新时间:2023-10-17 14:01:47