Springboot项目启动遇到如下报错

required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' that could not be found.
Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration.

解决办法

pom文件普通依赖替换为spring-boot-starter依赖

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-redis</artifactId>
    <version>2.7.10</version>
</dependency>

替换为

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>



版权声明:本文为wsx9172原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/wsx9172/article/details/130568720