【问题标题】:Springboot upgrade 1.5.8 to 2.0 release getting exception "org.springframework.beans.factory.NoSuchBeanDefinitionException"Springboot 升级 1.5.8 到 2.0 版本出现异常“org.springframework.beans.factory.NoSuchBeanDefinitionException”
【发布时间】:2018-09-13 10:49:27
【问题描述】:

kubernetes 相关的 Gradle 依赖:

  "io.fabric8:spring-cloud-kubernetes-core:0.1.6",
  "io.fabric8:spring-cloud-starter-kubernetes:0.1.6",
  "org.springframework.cloud:spring-cloud-starter-sleuth:1.2.4.RELEASE",

将 springboot 1.5.6 升级到 2.0.0.Release 时出现以下异常

方法configurationUpdateStrategy中的参数2 io.fabric8.spring.cloud.kubernetes.reload.C​​onfigReloadAutoConfiguration$ConfigReloadAutoConfigurationBeans 需要一个找不到的“org.springframework.cloud.context.restart.RestartEndpoint”类型的 bean。

  • 未加载 Bean 方法“restartEndpoint”,因为 @ConditionalOnClass 未找到所需的类“org.springframework.integration.monitor.IntegrationMBeanExporter”

  • 'RestartEndpointWithoutIntegrationConfiguration' 中的 Bean 方法 'restartEndpointWithoutIntegration' 未加载,因为 @ConditionalOnEnabledEndpoint 发现属性 management.endpoint.restart.enabled 值为 false

【问题讨论】:

  • 我遇到了同样的问题。你有没有解决它?
  • @MiguelRibeiro,您找到解决方案了吗?

标签: spring-boot spring-boot-actuator spring-boot-gradle-plugin


【解决方案1】:

根据您的要求,您可以执行以下任一操作:

  1. 如果您不需要,请禁用 ConfigReloadAutoConfiguration

    @SpringBootApplication(exclude = ConfigReloadAutoConfiguration.class)
    public class SomeApplication {
        ...
    }
    
  2. 将以下内容添加到您的application.properties 中,正如错误消息所述:

    management.endpoint.restart.enabled = true
    

【讨论】:

    猜你喜欢
    • 2014-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-24
    • 2022-07-22
    • 1970-01-01
    • 2023-01-03
    • 1970-01-01
    相关资源
    最近更新 更多