错误信息描述
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1
解决方式
网上的解决办法很多,但都解决不了
1、注解加参数,我的会出现新的问题
2、配置数据源,已配置
所以我最终比较两个相同的模块发现,出现问题的模块pom.xml和正常运行的pom.xml的文件的图标不一样,竟然没有蓝色的m,哈哈哈,右键—>add as maven project就可以了 !
本文解决了一个常见的SpringBoot应用启动失败的问题,错误信息显示未能正确配置DataSource,原因是未能确定合适的驱动类。通过对比相同模块,发现异常模块的pom.xml文件缺少Maven项目标记,解决方法是将该文件重新标记为Maven项目。
24万+

被折叠的 条评论
为什么被折叠?



