一、问题如下:

  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. 启动tomcat出现闪退的原因

    出现闪退的可能有几点: 1.没有安装jdk或者配置jdk是否配置成功 2.找不到jdk安装的路径 3.tomcat环境配置失败 如果是第二点原因(确保第一第三点配置都正确无误)找不到jdk路径的话,可 ...

  2. python3在科学计算中的三种常用数据结构

    在科学研究中,数据运算是必不可少的,下面介绍python语言在科学计算中常用的数据结构和运算函数. 主要数据结构: (1)列表,用中括号表示,元素之间逗号分隔,每个元素可以是数字,字符,也可以是列表, ...

  3. Linux 资源监控与性能测试

    综合管理 glances 系统情况监控 vmstat 能看到上下文切换,runnable进程个数,uninterrupted进程个数 磁盘IO iostat是磁盘级别监控,iotop进程级别监控,注意 ...

  4. 基于函数的I/O操作(头文件stdio.h)

    基于函数库的I/O是C语言标准库的功能,基于系统级I/O函数实现. 系统级I/O函数对文件的标识是文件描述符,C语言标准库中对文件的标识是指向FILE结构的指针.在头文件cstdio或stdio.h中 ...

  5. 第5章 if 语句

    第5章 if 语句 5.1 一个简单示例 cars = ['audi', 'bmw', 'subaru', 'toyota'] for car in cars: if car == 'bmw': pr ...

  6. JAVA虚拟机故障诊断总结

    一.JAVA运行时数据区               1.堆(-Xmx与-Xms):所有线程共享.  目的:用来存放对象实例.所有对象实例和数组都要在堆上分配内存.JAVA堆是垃圾收集器管理的主要区域 ...

  7. Linux操作命令和工具使用

    lrzsz是一个unix通信套件提供的X,Y,和ZModem文件传输协议. windows 需要向centos服务器上传文件,可直接在centos上执行命令yum -y install lrzsz 程 ...

  8. “计数质数”问题的常规思路和Sieve of Eratosthenes算法分析

    题目描述 题目来源于 LeetCode 204.计数质数,简单来讲就是求"不超过整数 n 的所有素数个数". 常规思路 一般来讲,我们会先写一个判断 a 是否为素数的 isPrim ...

  9. Mac 系统安装robot framework

    1.安装Python3 版本 2.安装robotframework:pip3 install robotframework 3.安装Pypubsub:pip3 install Pypubsub 4.安 ...

  10. Selenium 如何复用浏览器【解决扫码登录等问题】

    Selenium中复用已经打开的浏览器进行自动化测试,可以辅助我们解决某些登录需要扫二维码之后,才能进行的操作 目前只支持谷歌Chrome浏览器,那需要做哪些准备操作呢?往下看 1.windows和M ...