日常写完代码,重启准备查看效果,发现启动失败,报错了。
报错信息如下:
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
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).
百度了几篇文章都没解决问题,想着自己先试试能不能解决。
尝试1:重新编译项目,然后重启,还是失败。
尝试2:点击Reimport All Maven Projects,也失败了。
最后,执行mvn compile编译命令后,重启成功了
原来,是有某个.xml文件不见了,我们只需要重新编译一下项目文件即可。