springboot项目启动错误

tex 复制代码
** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.


2023-10-10 23:52:16.319  WARN 13036 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:D:\devloper\repository\org\springframework\boot\spring-boot-autoconfigure\2.6.3\spring-boot-autoconfigure-2.6.3.jar!/org/springframework/boot/autoconfigure/r2dbc/ConnectionFactoryConfigurations$PoolConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations$PoolConfiguration due to io/r2dbc/spi/ValidationDepth not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
2023-10-10 23:52:16.330  INFO 13036 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-10-10 23:52:16.366 ERROR 13036 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:D:\devloper\repository\org\springframework\boot\spring-boot-autoconfigure\2.6.3\spring-boot-autoconfigure-2.6.3.jar!/org/springframework/boot/autoconfigure/r2dbc/ConnectionFactoryConfigurations$PoolConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryConfigurations$PoolConfiguration due to io/r2dbc/spi/ValidationDepth not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)

因为使用了默认包进行了 @ComponentScan 扫描。默认情况下,Spring 只会扫描指定的包及其子包下的组件,如果没有指定任何包名,则默认扫描当前包及其子包下的所有组件。

将启动类放在一个包下即可。

相关推荐
i***395811 小时前
Springboot中SLF4J详解
java·spring boot·后端
子洋11 小时前
群晖 DSM 更新后 Cloudflare DDNS 失效的排查记录
前端·后端·dns
z***948411 小时前
springboot和springframework版本依赖关系
java·spring boot·后端
p***950011 小时前
spring Profile
java·数据库·spring
艺杯羹11 小时前
从Spring到SpringBoot3的演进:缺陷、优化与最新实践要求
java·spring boot·spring
一 乐11 小时前
宠物管理宠物医院管理|基于Java+vue的宠物医院管理系统(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·宠物
一 乐11 小时前
学习辅导系统|数学辅导小程序|基于java+小程序的数学辅导小程序设计与实现(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·学习·小程序
励志成为糕手11 小时前
基于SpringBoot的企业考勤管理系统设计与实现
java·spring boot·后端·web·企业应用
w***42411 小时前
Springboot中使用Elasticsearch(部署+使用+讲解 最完整)
spring boot·elasticsearch·jenkins
e***749511 小时前
SpringBoot项目集成ONLYOFFICE
java·spring boot·后端