一、问题如下:

  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问题处理的更多相关文章

  1. 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 ...

  2. 新建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 ...

  3. 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 : **** ...

  4. 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 ************ ...

  5. 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 ...

  6. 记一次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 ...

  7. 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 ...

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

    SpringBoot项目编译成功,启动报错 提示信息很明显,通过查看依赖关系,可以找到原因 导致这个问题的原因是因为,在 pom.xml 配置文件中,配置了数据连接技术 spring-boot-sta ...

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

    启动springboot的时候莫名其妙出现这个错误,我properties里面也没配置数据源啥的,但就是出现这个错误 解决方法: 在启动类上加@SpringBootApplication(exclud ...

随机推荐

  1. VM获取子网掩码和网关

  2. java基础-02:编译型和解释型

    Java程序运行机制: Java语言的编译-->解释-->运行过程 1.编译型语言:程序在执行之前需要一个专门的编译过程,把程序编译成为机器语言的文件,运行时不需要重新翻译,直接使用编译的 ...

  3. openvswitch ovs-appctl 使用

    参考链接:https://www.cnblogs.com/zqyanywn/p/10501590.html 1. fdb/show bridge 列出指定桥上每个MAC直至与VLAN的对应信息,并且包 ...

  4. 存储池与存储卷,使用virt-install创建虚拟机

    原文链接:https://www.cnblogs.com/zknublx/p/9199658.html 创建存储池 1.建立存储池的目录 mkdir /kvm/images 2.为了安全性,更改目录的 ...

  5. HYSBZ - 2243 树链剖分 + 线段树 处理树上颜色段数

    用线段树处理颜色段数 记录区间内的颜色段数,区间右端点的颜色,区间右端点的颜色. int tr[maxn<<2], lc[maxn<<2], rc[maxn<<2] ...

  6. WordCount( Java )

    Github项目地址:https://github.com/Sabot1203/WordCount 一. 题目描述 实现一个简单而完整的软件工具(源程序特征统计程序). 进行单元测试.回归测试.效能测 ...

  7. kali安装open-vm-tools实现虚拟机交互

    普通的VMware tools 弱爆了 安装具有复制粘贴功能的open-vm-tools.servic: 切记:如果之前已经安装了VMware tools,一定要删除:vmware-uninstall ...

  8. 6套MSP430开发板资料共享 | 免费下载

    ​目录 1-MSP430 开发板I 2-MSP430mini板资料 3-MSP430F149开发板资料 4-KB-1B光盘资料 5-LT-1B型MSP430学习板光盘 6-MSP-EXP430F552 ...

  9. 外链专员怎么做提升自己的seo水平

    http://www.wocaoseo.com/thread-281-1-1.html 我是一个外链专员,想提升自身的seo水平该怎么做? 随着SEO的学习,已经有了一段时间,平时也在思考好多事情,现 ...

  10. Pandas | Dataframe的merge操作,像数据库一样尽情join

    今天是pandas数据处理第8篇文章,我们一起来聊聊dataframe的合并. 常见的数据合并操作主要有两种,第一种是我们新生成了新的特征,想要把它和旧的特征合并在一起.第二种是我们新获取了一份数据集 ...