ConfigurationClassPostProcessor.importRegistry' available'

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available'.

Spring Boot应用中某些组件没有默认配置项,如数据库配置。

server.port=8080

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=pwd
spring.datasource.max-idle=10
spring.datasource.max-wait=10000
spring.datasource.min-idle=5

spring.redis.password=123456
spring.redis.host=127.0.0.1