运行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,特别要注意网络问题。

1
0

Java分布式后台开发 Spring Boot+Kafka+HBase

从零到一完整搭建企业级架构的通用卡包工程,让你迈到百度T4+ 。

886 学习 · 221 问题

查看课程