Springboot 应用程序无法启动

时间:2021-07-08 12:11:23

标签: redis dependencies pom.xml

我的 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中没有看到红色波浪线?

0 个答案:

没有答案