日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

引入redis報錯Bean method ‘redisConnectionFactory‘ not loaded because @ConditionalOnClass did not find

作者:YXWik6 更新時間: 2022-02-18 編程語言

1、Bean method ‘redisConnectionFactory‘ not loaded because @ConditionalOnClass did not find required c
在這里插入圖片描述
引入pom

  <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>2.3.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>

在這里插入圖片描述
在這里插入圖片描述
2.運行報錯
java.lang.NoSuchMethodError: org.springframework.data.redis.repository.configuration.RedisRepositoryConfigurationExtension.registerIfNotAlreadyRegistered(Ljava/util/function/Supplier;
在這里插入圖片描述

解決方案,更改pom

 <!-- redis 緩存操作 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>

在這里插入圖片描述

原文鏈接:https://blog.csdn.net/YXWik/article/details/120011110

欄目分類
最近更新