首页 > 解决方案 > 创建名为“compositeCompatibilityVerifier”的 bean 时出错

问题描述

我正在使用Spring Boot 2.5.5Spring Cloud Version 2020.0.4但是当我尝试运行应用程序时,我遇到了异常 -

Exception encountered during context initialization - cancelling refresh attempt:     
org.springframework.beans.factory.BeanCreationException: Error creating bean with name  
'compositeCompatibilityVerifier' defined in class path resource [org/springframework 
/cloud/configuration/CompatibilityVerifierAutoConfiguration.class]: Bean instantiation  
via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.cloud.configuration.CompositeCompatibilityVerifier]: Factory 
 method 'compositeCompatibilityVerifier' threw exception; nested exception is 
 org.springframework.cloud.configuration.CompatibilityNotMetException

pom.xml

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.5</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <java.version>1.8</java.version>
    <spring-cloud.version>2020.0.4</spring-cloud.version>
</properties>

<dependencies>
    <!-- Below jar file also has same Spring Boot Version -->
    <dependency>
        <groupId>com.another.project</groupId>
        <artifactId>commons</artifactId>
        <version>1</version>
        <scope>compile</scope>
    </dependency>

    <!-- other spring boot dependency -->
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

我有另一个项目jarpom其中也有同样Spring Boot Version的问题,我怀疑会导致问题,但不确定如何?

标签: spring-boot

解决方案


推荐阅读