Rumah >Java >Betulkan laluan kelas aplikasi supaya ia mengandungi versi tunggal org.springframework.beans.factory.config.ConfigurableListableBeanFactory yang serasi

Betulkan laluan kelas aplikasi supaya ia mengandungi versi tunggal org.springframework.beans.factory.config.ConfigurableListableBeanFactory yang serasi

王林
王林ke hadapan
2024-02-05 22:24:031052semak imbas
Kandungan soalan

Saya mendapat ralat berikut Permohonan tidak boleh bermula

Penerangan:

Cuba panggil kaedah yang tidak wujud. Cubalah dari:

org.springframework.boot.actuate.autoconfigure.startup.startupendpointautoconfiguration$applicationstartupcondition.getmatchoutcome(startupendpointautoconfiguration.java:63)

Kaedah berikut tidak wujud:

org.springframework.beans.factory.config.configurablelistablebeanfactory.getapplicationstartup()lorg/springframework/core/metrics/applicationstartup;

Kelas org.springframework.beans.factory.config.configurablelistablebeanfactory untuk kaedah ini boleh diperolehi daripada: jar: file:/users/doc/.m2/repository/org/springframework/spring-beans/5.2.5.release/spring-beans-5.2.5.release.jar! /org/springframework/beans/factory/config /configurablelistablebeanfactory.class

Ia dimuatkan daripada:

file:/users/doc/.m2/repository/org/springframework/spring-beans/5.2.5.release/spring-beans-5.2.5.release.jar

Tindakan:

Betulkan laluan kelas aplikasi untuk memasukkan satu versi serasi org.springframework.beans.factory.config.configurablelistablebeanfactory

pom

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.6.RELEASE</version>

</parent>



<properties>
    <java.version>1.8</java.version>
 

   
    <!-- Spring Dependencies -->
    <spring-retry.version>1.3.1</spring-retry.version>
    <spring-cloud-netflix-core.version>1.1.7.RELEASE</spring-cloud-netflix-core.version>
    <spring-cloud-vault-config.version>3.1.1</spring-cloud-vault-config.version>
    <spring-vault-core.version>2.3.2</spring-vault-core.version>
 



    <!-- Swagger Dependencies -->
    <springfox-swagger2.version>2.4.0</springfox-swagger2.version>

   
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
            <version>${spring-retry.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-netflix-core</artifactId>
            <version>${spring-cloud-netflix-core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-vault-config</artifactId>
            <version>${spring-cloud-vault-config.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.vault</groupId>
            <artifactId>spring-vault-core</artifactId>
            <version>${spring-vault-core.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Hoxton.SR6</version>
        </dependency>
       
        
       
        <!-- Swagger Dependencies-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
        <!-- Testing dependencies -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
  
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-vault-config</artifactId>
        <version>${spring-cloud-vault-config.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.vault</groupId>
        <artifactId>spring-vault-core</artifactId>
        <version>${spring-vault-core.version}</version>
    </dependency>
    
   
    <!-- Spring dependencies -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-actuator-autoconfigure</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.25</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.retry</groupId>
        <artifactId>spring-retry</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-openfeign</artifactId>
        <version>2.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
        <version>2.1.0.RELEASE</version>
    </dependency>

Jawapan betul


Anda cuba mengatasi prestasi but musim bunga dan pengurusan pergantungan awan musim bunga dengan sejumlah besar versi yang tidak serasi. Permudahkan pengurusan pergantungan hanya dalam dependencymanagement 部分添加 spring-cloud-dependency. Alih keluar semua yang lain kerana ia telah diuruskan oleh but musim bunga atau kebergantungan awan musim bunga yang anda miliki.

Seterusnya daripada dependencie 部分的依赖项中删除版本,并删除 spring-boot-actuator-autoconfiguration 依赖项,该依赖项包含在 spring-boot-starter.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.13.RELEASE</version>
</parent>

<properties>
    <java.version>1.8</java.version>

    <!-- Swagger Dependencies -->
    <springfox-swagger2.version>2.4.0</springfox-swagger2.version>

   
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Hoxton.SR12</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- Swagger Dependencies-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
        <!-- Testing dependencies -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>${springfox-swagger2.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
  
    <!-- Spring dependencies -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.retry</groupId>
        <artifactId>spring-retry</artifactId>
    </dependency>

    <!-- Spring Cloud Starter -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-openfeign</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-vault-config</artifactId>
    </dependency>
   
</dependencies>

Pergantungan kini diurus dengan betul oleh but musim bunga dan awan musim bunga dalam versi yang serasi.

Atas ialah kandungan terperinci Betulkan laluan kelas aplikasi supaya ia mengandungi versi tunggal org.springframework.beans.factory.config.ConfigurableListableBeanFactory yang serasi. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan:
Artikel ini dikembalikan pada:stackoverflow.com. Jika ada pelanggaran, sila hubungi admin@php.cn Padam