Springboot upgrade 1.5.8 to 2.0 release getting exception “org.springframework.beans.factory.NoSuchBeanDefinitionException”

风流意气都作罢 提交于 2019-12-24 07:34:59

问题


Gradle dependency related to kubernetes:

  "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",

Getting the below exception while upgrading springboot 1.5.6 to 2.0.0.Release

Parameter 2 of method configurationUpdateStrategy in io.fabric8.spring.cloud.kubernetes.reload.ConfigReloadAutoConfiguration$ConfigReloadAutoConfigurationBeans required a bean of type 'org.springframework.cloud.context.restart.RestartEndpoint' that could not be found.

  • Bean method 'restartEndpoint' not loaded because @ConditionalOnClass did not find required class 'org.springframework.integration.monitor.IntegrationMBeanExporter'

  • Bean method 'restartEndpointWithoutIntegration' in 'RestartEndpointWithoutIntegrationConfiguration' not loaded because @ConditionalOnEnabledEndpoint found property management.endpoint.restart.enabled with value false


回答1:


You can do either of following, depending on your requirements:

  1. Disable ConfigReloadAutoConfiguration if you don't need it:

    @SpringBootApplication(exclude = ConfigReloadAutoConfiguration.class)
    public class SomeApplication {
        ...
    }
    
  2. Add the following into your application.properties, just as the error message says:

    management.endpoint.restart.enabled = true
    


来源:https://stackoverflow.com/questions/49641443/springboot-upgrade-1-5-8-to-2-0-release-getting-exception-org-springframework-b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!