SpringBoot框架:'url' attribute is not specified and no embedded datasource could be configured问题处理
一、问题如下:
Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
未能配置数据源:“url”属性未指定,无法配置嵌入式数据源。
Reason: Failed to determine a suitable driver class.
无法确定合适的驱动程序类别。

二、 问题解决:
1、问题分析:
在程序的配置文件中添加引入了数据库驱动依赖包,springboot程序就自动去进行数据连接,但是因为没有配置数据库的连接信息,所以就会报错。
2、问题解决:
(1)去掉自动连接:
在未配置数据库连接信息时,可以将入口类中的注解修改为以下代码:
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
即添加(exclude = {DataSourceAutoConfiguration.class}),排除自动连接。
(2)配置数据源信息:
在application.yml中配置数据库的连接信息,运行程序就不会报错。
SpringBoot框架:'url' attribute is not specified and no embedded datasource could be configured问题处理的更多相关文章
- springboot启动报错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
新建了一个springboot项目报一下错误: Failed to configure a DataSource: 'url' attribute is not specified and no em ...
- 新建springboot项目启动出错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
错误信息入下: 2018-06-23 01:48:05.275 INFO 7104 --- [ main] o.apache.catalina.core.StandardService : Stopp ...
- springboot项目启动报错 url' attribute is not specified and no embedded datasource could be configured
报错相关信息: 2019-07-22 17:12:48.971 ERROR 8312 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : **** ...
- SpringBoot使用mybatis,发生:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured
最近,配置项目,使用SpringBoot2.2.1,配置mybatis访问db,配好后,使用自定义的数据源.启动发生: APPLICATION FAILED TO START ************ ...
- Spring Boot错误——SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
背景 使用Spring Cloud搭建微服务,服务的注册与发现(Eureka)项目启动时报错,错误如下 *************************** APPLICATION FAILED T ...
- 记一次Spring boot集成mybatis错误修复过程 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
最近自己写了一份代码签入到github,然后拉下来运行报下面的错误 Error starting ApplicationContext. To display the conditions repor ...
- 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 消费者提示需要配置数据源
使用 由于给前端做分页 在启动消费者的时候遇到了这个问题 Failed to configure a DataSource: 'url' attribute is not specified and ...
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
SpringBoot项目编译成功,启动报错 提示信息很明显,通过查看依赖关系,可以找到原因 导致这个问题的原因是因为,在 pom.xml 配置文件中,配置了数据连接技术 spring-boot-sta ...
- 奇葩的Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
启动springboot的时候莫名其妙出现这个错误,我properties里面也没配置数据源啥的,但就是出现这个错误 解决方法: 在启动类上加@SpringBootApplication(exclud ...
随机推荐
- Linux命令--vi/vim复制一行,粘贴
在光标的位置按“yy”,复制当前行: 然后再光标的行按“p”,粘贴到下一行,原来的往下顺移
- 「完整案例」基于Socket开发TCP传输客户端
1 程序界面设计 TCP客户端在上位机开发中应用很广,大多数情况下,上位机软件都是作为一个TCP客户端来与PLC或其他服务器进行通信的.TCP客户端的主要功能就是连接服务器.发送数据.接收数据.断开 ...
- golang方法
1.方法声明 在函数声明时,在其名字之前放上一个变量,即是一个方法.这个附加的参数会将该函数附加到这种类型上,即相当于为这种类型定义了一个独占的方法. package main import &quo ...
- Today At AntDock 2020年8月21日
前段时间,我在 Mac 上使用 CLion 进行 C++ 编译,但发现 #include<bits/stdc++.h> 居然出了问题,无法使用,Xcode 也不行.我试图查找资料,但一般都 ...
- Spark on Yarn运行时加载的jar包
spark on yarn运行时会加载的jar包有如下: spark-submit中指定的--jars $SPARK_HOME/jars下的jar包 yarn提供的jar包 spark-submit通 ...
- dpkg:处理 xxx (--configure)时出错解决办法
1.$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名2.$ sudo mkdir /var/lib/dpkg/info ...
- python numpy数组操作
数组的创建 import numpy as np arr1 = np.array([3,10,8,7,34,11,28,72]) arr2 = np.array(((8.5,6,4.1,2,0.7), ...
- Java面试题(Spring Boot/Spring Cloud篇)
Spring Boot/Spring Cloud 104.什么是 spring boot? SpringBoot是一个框架,一种全新的编程规范,他的产生简化了框架的使用,所谓简化是指简化了Spring ...
- 微信小程序自动化
解析微信小程序 注意:若上面方法不行就使用下面的 小程序对应的chrome驱动版本包,2.4版本的
- docker run <image-id>和 docker start <container-id>