Springboot 应用程序无法启动

问题描述

我的 pom.xml 中有这些依赖项:

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

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

    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>3.3.0</version>
        <type>jar</type>
    </dependency>

应用程序无法启动util 我打开redis服务器,报错如下:

***************************

应用程序无法启动


说明:

尝试调用不存在的方法。尝试是从以下位置进行的:

org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration.getStandaloneConfig(RedisConnectionConfiguration.java:69)

以下方法不存在:

'void org.springframework.data.redis.connection.RedisStandaloneConfiguration.setUsername(java.lang.String)'

方法的类 org.springframework.data.redis.connection.RedisStandaloneConfiguration 可从以下位置获得:

jar:file:/Users/chenmin/.m2/repository/org/springframework/data/spring-data-redis/2.3.3.RELEASE/spring-data-redis-2.3.3.RELEASE.jar!/org/springframework/data/redis/connection/RedisStandaloneConfiguration.class

从以下位置加载了类层次结构:

org.springframework.data.redis.connection.RedisStandaloneConfiguration: file:/Users/chenmin/.m2/repository/org/springframework/data/spring-data-redis/2.3.3.RELEASE/spring-data-redis-2.3.3.RELEASE.jar

操作:

更正应用程序的类路径,使其包含一个兼容版本的 org.springframework.data.redis.connection.RedisStandaloneConfiguration

为什么?这背后的原理是什么?如果不打开Redis服务器就无法导入依赖,为什么我在pom.xml中没有看到红色波浪线?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)