一、问题如下:

  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. golang slice 简单排序

    原文链接:https://www.jianshu.com/p/603be4962a62 demo package main import ( "fmt" "sort&qu ...

  2. 安全可靠国产系统背景下的应用开发应有.NET Core的一席之地

    在中美当前背景下的安全可靠国产系统(简称安可),安可产业要实现技术自主可控,需要在四个层面逐步实现:基础硬件设施,如芯片.服务器.存储.交换机.路由器:底层软件,包括操作系统.数据库.中间件等:应用软 ...

  3. Shell编程—gawk进阶

    1使用变量 awk编程语言支持两种不同类型的变量: 内建变量 自定义变量 1.1内建变量 1. 字段和记录分隔符变量 数据字段变量允许你使用美元符号($)和字段在该记录中的位置值来引用记录对应的字段. ...

  4. jdk 功能变化

    JDK的变化 JDK1.5 JDK1.6 jdk1.7 1. 添加自动装箱,拆箱   1. =后可以省略泛型, 见ArrayList 2. try后加一个(), 定义流对象,作用域在try里 jdk1 ...

  5. 面经手册 · 第7篇《ArrayList也这么多知识?一个指定位置插入就把谢飞机面晕了!》

    作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.前言 数据结构是写好代码的基础! 说到数据结构基本包括:数组.链表.队列.红黑树等,但当你 ...

  6. 8.深入k8s:资源控制Qos和eviction及其源码分析

    转载请声明出处哦~,本篇文章发布于luozhiyun的博客:https://www.luozhiyun.com,源码版本是1.19 又是一个周末,可以愉快的坐下来静静的品味一段源码,这一篇涉及到资源的 ...

  7. Spring Cloud系列(一):微服务架构简介

    一.微服务概述 1.微服务是什么 微服务架构的核心就是服务的拆分,把传统的单体式应用,根据一定的维度(比如业务)拆分为一个一个的服务,每一个服务都有自身特定的功能,又都能够独立的部署,甚至可以拥有自己 ...

  8. jieba分词-强大的Python 中文分词库

    1. jieba的江湖地位 NLP(自然语言)领域现在可谓是群雄纷争,各种开源组件层出不穷,其中一支不可忽视的力量便是jieba分词,号称要做最好的 Python 中文分词组件. 很多人学习pytho ...

  9. Android项目智能机器人的实现,带有源代码,图灵智能机器人,详细讲解。。

    大家好,今天给大家推荐一个我利用图灵api制作的android项目,智能机器人,类似智能小冰,等一些会机器人. 下面看效果.女头像是系统自动给你回复的,男头像是你输入的内容.项目源代码是eclipse ...

  10. systemctl 如何启动、关闭、启用/禁用服务

    启动服务:systemctl start xxx.service 关闭服务:systemctl stop xxx.service 重启服务:systemctl restart xxx.service ...