SpringBoot系列——>异常报错现象
我们在进行开发的时候,会遇到很多bug,和异常报错现象,下面是我最近遇见的一种报错,也是一种常见型的报错,对此发现了几种解决方案,希望对大家有所帮助
问题:
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).
一般出现这种问题主要原因在于pom文件,一些测试包括一些新建的项目并没有配置JDBC数据源等一系列问题,所以我们只要把这些东西注释掉,在运行项目,等后期需要哪些依赖再加进去就OK了
如(我新建的项目,一个简单的输出):
记得依赖注释后一定要刷新
项目刷新
maven刷新
如此在重新启动就没问题了
最后
更多参考精彩博文请看这里:倾宸的博客
喜欢博主的小伙伴可以加个关注、点个赞哦,持续更新嘿嘿!***