运行RedisTemplateTest出错
来源:6-34 用户应用子系统 - TestCase 书写样例

weixin_慕码人2458807
2022-04-07
cuowu
RedisTemplateTest类上的错误:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
testRedisTemplate方法上的错误:
org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.
请问老师怎么解决呀
1回答
-
张勤一
2022-04-08
同学你好:
可以看到这里的报错的 Root Cause,是 Redis 连接失败造成的。可以简单写个 demo 看看能不能在你的机器上连接 Redis,特别要注意网络问题。
10
相似问题