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 ...
随机推荐
- async + await 异步
先执行A在执行B再执行.then里面的AAA() { XXXXX一堆代码 this.BBB().then(()=>{ 其他代码 })}, async BBB(){ let res = await ...
- Arrays中toString 和 binarySearch 的原代码
只是记住方法是干什么的,但是对具体方法的理解还是不够 查找方法 当所查找的不存在的时候 返回值应该是 return -(low + 1); 一直知道toString 是转换成为字符串 但是具体的 ...
- JavaScript学习系列博客_23_JavaScript 构造函数
构造函数 - 构造函数是专门用来创建对象的函数 创建一个对象时,通过构造函数的方式来创建.这是通过Object()这个构造函数来创建的一个实例obj. var obj=new Object(); - ...
- 正则表达式截取xml
$str = '<Ips><GateWayRsp><head><ReferenceID>123</ReferenceID><RspCo ...
- 设置Anaconda启动jupyter的默认目录
要解决的问题:安装好Anaconda后打开jupyter总是会自动跳到c:下的用户目录,通过以下方法可以修改其默认打开的目录 吐槽:竟然没有设置默认打开目录的选项,只能通过修改配置文件完成,让人不爽. ...
- 计算机网络-应用层(5)P2P应用
P2P系统的索引:信息到节点位置(IP地址+端口号)的映射 在文件共享(如电驴中):利用索引动态跟踪节点所共享的文件的位置.节点需要告诉索引它拥有哪些文件.节点搜索索引从而获知能够得到哪些文件 在即时 ...
- 【转】camera tuning
chromatix项目必须包含有效的 ADC image.png filcker: 交流电照明灯发出的光会一定频率的抖动导致sensor图像出现行方向的水波纹,称之为filcker.目前主要的交流电频 ...
- C# Mongo DB 修改多层嵌套集合中的字段
C# Mongo DB 修改嵌套集合中的字段 虽然c#的mongo 驱动很强大,而且还支持linq,但是一些复杂的操作语句还是比较困难 这里我用Bson实现功能 这是模型(我这里有多层嵌套) publ ...
- 哇,ElasticSearch多字段权重排序居然可以这么玩
背景 读者提问:ES 的权重排序有没有示列,参考参考? 刚好之前也稍微接触过,于是写了这篇文章,可以简单参考下. 在很多复杂的业务场景下,排序的规则会比较复杂,单一的降序,升序无法满足日常需求.不过 ...
- 洛谷 P4284 [SHOI2014]概率充电器 概率与期望+换根DP
洛谷 P4284 [SHOI2014]概率充电器 概率与期望+换根DP 题目描述 著名的电子产品品牌\(SHOI\) 刚刚发布了引领世界潮流的下一代电子产品-- 概率充电器: "采用全新纳米 ...