问题描述
项目可以正常运行,但是出现以下报错↓
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBean' defined in com.org.my.BeanContainer: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
问题分析
- 看项目源代码少注解,还是注解附近相关代码有问题
- 看项目xml文件有无写错的地方,或少写某些配置
- 热部署没关
问题解决
1.注解少写的话,项目逻辑也就少了一部分,所以SpringBoot后台自动配置会报错。加上你需要添加的注解,或者修改。
参考文章: