IDEA启动spring 项目的时候报错内容如下.
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).

解决方案有2个, 一个是在启动类的头部加一个注解.
不建议这么干, 这样干了就不能自动更新数据库表结构了.
@SpringBootApplication

IDEA启动Spring项目报错,有两种解决方案。一是在启动类头部加注解,但会影响数据库表结构自动更新;二是解决问题根源,可能是配置未配或数据库驱动类缺失,可检查pom.xml配置并在IDEA中更新配置让Maven下载jar包。
最低0.47元/天 解锁文章
2308

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



