您的位置:首页 >如何解决Spring Boot整合Redis报错的问题?
发布于2023-04-27 阅读(0)
扫一扫,手机访问
org.springframework.data.redis.connection.RedisConnectionFactory’ that could not be found
Error creating bean with name ‘redisTemplate’ defined in class path resource
我是因为没有引入jedis依赖造成的报错。还有原因是由于jedis 和spring-boot-starter-data-redis 的maven依赖的版本不兼容导致, 是经常会出现的问题。出现JedisConnectionFactory 无法创建也是一样。
只需要引入jedis依赖,即可解决
<!--redis缓存--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--spring boot2.x以上版本需要引入,不然启动会报错!--> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency>
再次启动
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
正版软件
正版软件
正版软件
正版软件
正版软件
1
2
3
7
9