Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could

梦里梦外; 2023-08-17 15:32 473阅读 0赞

springboot项目启动错误:

  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).
  11. Disconnected from the target VM, address: '127.0.0.1:59265', transport: 'socket'
  12. Process finished with exit code 0

解决方法:在启动类上取消数据源自动配置

  1. @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

发表评论

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

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

相关阅读