springboot redis Unsatisfied dependency expressed through method ‘redisTemplate‘ parameter 0

pom.xml中导入包更换写

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

换成

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
    <exclusions>
       <exclusion>
            <groupId>io.lettuce</groupId>
            <artifactId>lettuce-core</artifactId>
       </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
</dependency>

 

上一篇:UnsatisfiedDependencyException: Unsatisfied dependency expressed through field ‘person‘


下一篇:Spring boot Unsatisfied dependency expressed through method的一个原因