文字描述:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-05 17:18:57.719 ERROR 4372 --- [ 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).
图片描述
解决方法:
问题描述:
该问题可能是自己不小心导入依赖,导入错误了。
网上百度时,也找到一个方案:
在消费者启动类上加上注解:
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
但是我个人测试发现出现另外一个小bug(暂时没发现是否影响运行)
如图:
考虑到项目不同的原因,所以将两个解决方案贴出来。
可以两个都试试。