初学者启动springboot报错
程序员文章站
2022-07-15 16:18:46
...
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-25 16:27:02.807 ERROR 16256 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following situation:
If you want an embedded database like H2, HSQL or Derby, please add it in the Classpath.
If you have database settings to be loaded from a particular profile you may need to activate it since no profiles were currently active.
报错显示无法找到数据源!Failed to auto-configure a DataSource: ‘spring.datasource.url’ is not specified and no embedded
原因是:pom配置文件中mysql未成功配置
第一种解决方式:在启动类springbootapplication后加上(exclude={DataSourceAutoConfiguration.class}),表示暂时不需要数据库组件
第二种解决方式:pom配置文件中mysql依赖重新添加成功。
按照以上方式便可成功启动。
推荐阅读
-
springboot linux启动方式
-
springboot工程启动即执行一段代码
-
php 启动报错如何解决
-
ubuntu1604环境下mariadb启动卡住报错和apparmor基本使用
-
Android Studio启动报错Java 1.8 or later is required的解决方法
-
主动报错的电脑启动故障现象分析
-
springboot 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.example.service.HrService' avai
-
ORACLE运行报错“ORA-01081:无法启动已在运行的ORACLE-请首先关闭它”的解决办法
-
IDEA 配置 SpringBoot 启动端口
-
启动mysql的时候,报错pid的解决办法