一、错误描述
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-08-09 14:24:35.419 ERROR 2916 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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).
二、解决方法
在网上翻看了一些博客,找到了问题的缘由,翻译过来就是无法配置Datasource和url属性未指定
这些解决方案都尝试之后,发现都没有用,最终的解决办法是在启动类的头部加入以下内容
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
加入之后重新运行就没有报错了

24万+

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



