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 只会扫描指定的包及其子包下的组件,如果没有指定任何包名,则默认扫描当前包及其子包下的所有组件。

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

相关推荐
AI进化营-智能译站几秒前
ROS2 C++开发系列11-VS Code一键生成Doxygen注释|让ROS2节点文档自动跟上代码迭代
java·数据库·c++·ai
bzmK1DTbd8 分钟前
OpenGL与Java:JOGL库的3D图形渲染实战
java·3d·图形渲染
许彰午8 分钟前
CacheSQL(四):CacheSQLClient——用一张路由表实现水平扩展
java·数据库·缓存·系统架构·政务
许彰午12 分钟前
CacheSQL(三):双 HTTP 引擎与 SQL 查询——接口抽象的价值
java·数据库·sql·缓存
Victor3561 小时前
MongoDB(118)如何在升级过程中进行数据备份?
后端
手握风云-1 小时前
Spring AI:让大模型住进 Spring 生态(三)
java·后端·spring
Victor3561 小时前
MongoDB(117)如何从旧版本迁移到新版本?
后端
咸鱼2.02 小时前
【java入门到放弃】Dubbo
java·开发语言·dubbo
pe7er4 小时前
window管理开发环境篇 - 持续更新
前端·后端
JAVA面经实录9178 小时前
Java企业级工程化·终极完整版背诵手册(无遗漏、全覆盖、面试+落地通用)
java·开发语言·面试