2021-08-10spring boot启动报错Error starting ApplicationContext(application和前端问题)

主要错误:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

未能配置数据源:未指定“url”属性,也无法配置嵌入式数据源。

复制代码

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-03 09:47:45.300 ERROR 23160 --- [           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).

解决方案:

application配置8080跟前端src里面的main.js8091配置不一致才数据源未找到url属性

 在main.js中修改url改成8080就好了,前后端端口必须一致

您好!对于您的报错问题,可以尝试按照以下步骤进行排查和解决: 1. 首先,根据报错信息中的提示,重新运行您的应用程序时启用调试模式,以获得更详细的条件报告。在命令行中运行您的Spring Boot项目时,添加`--debug`选项。例如:`java -jar your-application.jar --debug` 2. 检查您的应用程序的日志文件,查找更详细的错误信息。通常,Spring Boot应用程序的日志文件位于项目的根目录下的`logs`文件夹中,名为`application.log`或类似的文件。 3. 检查应用程序的依赖关系和配置文件。确保所有依赖项的版本兼容,并且配置文件(如`application.properties`或`application.yml`)正确配置。 4. 确认您的应用程序是否缺少必要的依赖项。可以通过在命令行中运行`mvn dependency:tree`(如果使用Maven)或`gradle dependencies`(如果使用Gradle)查看依赖关系树。 5. 检查应用程序的入口类和配置类。确保它们被正确定义并标注了Spring注解,比如`@SpringBootApplication`。 6. 如果您使用了数据库,请确保数据库连接配置正确,包括数据库URL、用户名和密码等。 7. 如果您的应用程序使用了外部服务或资源(如消息队列、缓存、文件系统等),请检查它们的配置和可用性。 如果您在排查过程中遇到其他问题或需要更多帮助,请提供更多的详细信息,我将尽力协助您解决问题
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值