才写了一行代码又报错了..


***************************
APPLICATION FAILED TO START
*************************** Description: 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 Action: Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). Disconnected from the target VM, address: '127.0.0.1:58792', transport: 'socket' Process finished with exit code 0

未指定“url”属性,无法配置嵌入的数据源。

原因:由于添加了数据库组件,所以autoconfig会去读取数据源配置,新建的项目还没有配置数据源,所以会导致异常出现。

解决办法:

在启动类添加如下内容

即:@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

转自:悟世君子的博客

Failed to configure a DataSource 'url' attribute问题解决的更多相关文章

  1. SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embe

    问题描述 *************************** APPLICATION FAILED TO START *************************** Description ...

  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启动报错 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 ...

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

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

  6. springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde

    springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...

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

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

  9. SpringBoot项目刚刚创建就报异常,Failed to configure a DataSource: 'url' attribute is not specified and no embedded 的解决办法

    错误信息: Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedde ...

随机推荐

  1. 关于spring中事务管理的几件小事

    1.Spring中的事务管理 作为企业级应用程序框架,Spring在不同的事务管理API之上定义了一个抽象层.而应用程序开发人员不必了解底层的事务管理API,就可以使用Spring的事务管理机制. S ...

  2. 调用打码平台api获取验证码 (C#版)

    一.打码平台很多,这里选择两个:联众和斐斐 联众开发文档: https://www.jsdati.com/docs/guide 斐斐开发文档: http://docs.fateadm.com/web/ ...

  3. JS 实现继承的方法 ES6 and ES5

    继承 ES6 方法  (类的继承) ES6中有一个属性的 extends 语法: ​ • class Father {} ​ • class Son extends Father{} ​ 注意:是子类 ...

  4. 命令行工具--LLDP

    目录 命令行工具--LLDP 一.场景引入 二.什么是LLDP? 三.在CentOS上安装LLDP 四.命令详解 五.脚本 命令行工具--LLDP 一.场景引入 有的时候,我们需要知道服务器上联交换机 ...

  5. Django的配置模板路径

    Django的配置模板路径 找到settings.py 配置静态目录: 注:创建静态文件名就用static 不要用别的. 两个函数.  return   redirect ('http//:www.b ...

  6. Linux Centos虚拟机扩容

    Linux Centos虚拟机扩容(/dev/mapper/centos-root) 1:.首先查看我们的根分区大小是多少 df -h 文件系统 类型 容量 已用 可用 已用% 挂载点``/dev/m ...

  7. github(工蜂)密码过期时sourcetree重新登录

  8. shell实现并发控制

    需求:并发检测1000台web服务器状态(或者并发为1000台web服务器分发文件等)如何用shell实现?                                              ...

  9. linux基础_用户和组的三个文件

    1./etc/passwd文件 用户(user)的配置文件,记录用户的各种信息 每行的含义:用户名:口令:用户标识号:组标识号:注释性描述:主目录:登录shell 2./etc/shadow文件 口令 ...

  10. 正整数n拆分成几个不同的平方数——DFS&&打表

    考虑将正整数n拆分成几个不同的平方数之和,比如30=1^2 + 2^2 + 5^2=1^2 + 2^2 + 3^2 + 4^2,而8不存在这样的拆分. #include<bits/stdc++. ...