报错 - NoSuchMethodError: org.apache.tomcat.InstanceManager.backgroundProcess()V

最近公司重构项目- -  某个需求需要使用MongoDB..搭建环境的时候  出现这个问题.... 看了其他博客说要降低SpringBoot内置的Tomcat版本- - 但是试了几次都没啥用  还是会报这个错误.. 最后在SpringBoot的的Issues中找到了答案..

贴出issue地址

https://github.com/spring-projects/spring-boot/issues/19308

@Bean
public static BeanFactoryPostProcessor removeTomcatWebServerCustomizer() {
    return (beanFactory) -> 
        ((DefaultListableBeanFactory)beanFactory).removeBeanDefinition("tomcatWebServerFactoryCustomizer");
}

 

posted @ 2020-12-31 16:38  腹肌有啥用  阅读(186)  评论(0)    收藏  举报