springboot项目启动提示:Failed to configure a DataSource: 'url' attribute is not specified and no embedde

我会带着你远行 2023-10-17 23:28 193阅读 0赞

本文参考:https://blog.csdn.net/coyotess/article/details/80637837

错误内容:

  1. ***************************
  2. APPLICATION FAILED TO START
  3. ***************************
  4. Description:
  5. Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
  6. Reason: Failed to determine a suitable driver class
  7. Action:
  8. Consider the following:
  9. If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
  10. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

解决方法:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

  1. @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
  2. @ImportResource("classpath:consumer.xml")
  3. public class EmsWebApplication {
  4. public static void main(String[] args) throws Exception{
  5. SpringApplication.run(EmsWebApplication.class, args);
  6. }
  7. }

源码分析:待补充。

发表评论

表情:
评论列表 (有 0 条评论,193人围观)

还没有评论,来说两句吧...

相关阅读