【解决异常】org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
【解决异常】org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available)
创建新springboot项目时,启动后报的错
springboot版本为2.3.0
排查后的原因
引入了如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
解决
注释掉这个依赖或者删掉就好了
异常信息
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.jav