springboot报错‘url’ attribute is not specified and no embedded datasource could

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).
1、首先看连接datasource数据库的配置写了没,就是下面代码有没有在配置文件中写

spring:
  datasource:
      username: aa
      password: aa
      url: 数据库连接地址
      driver-class-name: oracle.jdbc.OracleDriver

2、如果有,在application.yml配置文件中修改端口名为7777,再重新运行,看报错提示信息的端口,如果端口不是7777,证明没有进入application.yml,按eclipse的maven-update project勾选force update

server:
	port: 7777
回答: 这个错误提示意味着在配置数据源时没有指定'url'属性,并且没有配置嵌入式数据源。\[1\]\[2\]\[3\] 数据源是应用程序与数据库之间的连接,它包含了连接数据库所需的信息,如数据库的URL、用户名和密码等。在这种情况下,应该检查配置文件中是否正确指定了数据库的URL属性,并确保数据库的连接信息正确无误。如果使用的是嵌入式数据源,需要确保已正确配置了相关的依赖项。 #### 引用[.reference_title] - *1* [Failed to configure a DataSource: 'url' attribute is not specified and no embedded 的三种解决办法](https://blog.csdn.net/qq_34322008/article/details/89954934)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Failed to configure a DataSource: ‘urlattribute is not specified and no embedded datasource 已...](https://blog.csdn.net/weixin_44259720/article/details/105416113)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Failed to configure a DataSource: ‘urlattribute is not specified and no embedded 的三种解决办法](https://blog.csdn.net/chairongdian/article/details/126638646)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值