在springboot项目中,需要使用RedisTemplate类时,提示不能够自动注入,

项目中在引入RedisTemplate类时,引入的jar包依赖为:

1      <dependency>
2             <groupId>org.springframework.data</groupId>
3             <artifactId>spring-data-redis</artifactId>
4 <!--            <version>2.1.4.RELEASE</version>-->
5         </dependency>

将依赖更改为:

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

RedisTemplate类成功注入!

 

相关文章:

  • 2022-01-01
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-01-01
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-03-31
  • 2021-09-28
  • 2021-06-02
  • 2021-10-29
  • 2022-12-23
相关资源
相似解决方案