一、问题如下:

  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. JavaScript学习系列博客_13_JavaScript中的对象(Object)简介

    对象 对象属于一种复合的数据类型,在对象中可以保存多个不同数据类型的属性.除了那5种基本数据类型,就是对象. 分类:1.内建对象- 由ES标准中定义的对象,在任何的ES的实现中都可以使用- 比如:Ma ...

  2. HDFS 2.X新特性

    1 集群间数据拷贝 1.scp实现两个远程主机之间的文件复制 scp -r hello.txt root@hadoop103:/user/atguigu/hello.txt // 推 push scp ...

  3. 快速排序算法简述及python的实现

    def kp(arr, i, j): if i<j: #i=j时意味着一边只剩单个数据 base = kpgc(arr, i, j) kp(arr, i, base-1) #kp(arr, i, ...

  4. 团队作业4:第五篇Scrum冲刺博客(歪瑞古德小队)

    目录 一.Daily Scrum Meeting 1.1 会议照片 1.2 项目进展 二.项目燃尽图 三.签入记录 3.1 代码/文档签入记录 3.2 Code Review 记录 3.3 issue ...

  5. 【转】Windows10删除文件时却提示文件不存在的解决方案

    Windows10系统使用一段时间后用户都会定期进行删除清理系统垃圾,减少系统盘的容量占用,但在删除的过程中许多用户都有可能遇到无法删除的情况,如下为删除文件时却提示文件不存在的解决方案. 1.新建一 ...

  6. 迷上我成真恋爱学心理学挽回她PDF文档资料完整版情感技巧脱单教程

    迷上我成真恋爱学心理学挽回她PDF文档资料完整版情感技巧脱单教程 成真迷上我偷听女人心挽回她课程 百度网盘迷上我教程pdf地址 百度网盘挽回她教程pdf+视频的地址 备用地址淘宝百度网盘发货地址 百度 ...

  7. Java高级特性——反射机制(第二篇)

    在Java高级特性——反射机制(第一篇)中,写了很多反射的实例,可能对于Class的了解还是有点迷糊,那么我们试着从内存角度去分析一下. Java内存 从上图可以看出,Java将内存分为堆.栈.方法区 ...

  8. formily-面向中后台场景的复杂解决方案

    正文 在解决企业级应用的前端问题中,表单是个无法绕过的大山,正好最近有时间,调研一下 Formily-来自阿里巴巴的面向中后台复杂场景的表单解决方案,也是一个表单框架,前身是 UForm.主要解决如何 ...

  9. js区别对象和数组的三种方法

    var arr = {}||[];            区分arr是数组还是对象            1.arr.constructor                              ...

  10. codeblocks显示:不支持的16位应用程序 解决办法

    我是win10 64位系统,写c++运行就会显示不兼容16位应用程序.以前编出来的exe还能用,今天编出的就炸了. 试了用vs编译.vs能用. 试了网上找的各种解决方案, 360修复, 注册表, 重构 ...