Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."
一开始按照网上的很多解决办法是:
启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除掉我自己的数据库配置,
检查了很多地方都没发现问题在哪里,最后自己猜想不论怎么修改application.yml文件,都不生效,是不是因为这个配置文件就没有被加载到?
带着这个想法我就去网上搜了一下问题,有个问题看到了target目录的作用,就去想了一下是不是application.yml文件没有被编译出来到target目录下,
首先查看了正常项目里面target目录下面是有application.yml这个配置文件的,

接下来是启动报错的项目,发现target目录下并没有这个application.yml:

所以最后将application.yml拷贝到target目录下项目就可以正常启动了!
Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."的更多相关文章
- 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 ...
- 新建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 ...
- 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 ...
- spring boot添加logging不能启动且不报错
1.问题: application.yml中添加logging启动失败,不报错,去除后又正常 logging: config: classpath:test-logback-spring.xml报错 ...
- 记一次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 ...
- 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 : **** ...
- 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 创建 ...
- 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 ...
- springboot启动报错Failed to configure a DataSource
2018-11-21 19:43:12.076 WARN 5392 --- [ main] ConfigServletWebServerApplicationContext : Exception e ...
随机推荐
- django框架中的静态文件引入
首先在项目文件中新建文件夹static 之后在settings.py中配置路径 如下图所示: 下一步在你刚创建的static文件夹中添加app的文件夹名称,例如:teacher,如下图: 之后在tea ...
- 那些不懂hystrix的秘密
一 前言 springcloud系列文章已经出到hystrix,中间知识追寻者跑去学了其它知识,回来感觉spingcloud系列出的也不少了:需要完全理解这篇文章对于初学者需要有一定的基础知识,如果看 ...
- 暑假提高组集训Day1 T2
那么这一道题我在考试的时候写挂了(0分 呜呜~) 我原来的思路是广搜来骗取部分分(哈哈~) 但是我忘记了一个非常重要的问题 我广搜开的数组没有考虑负的下标 下一次考试如果再写暴力 就可以把坐标都加上一 ...
- 第二篇:python中的字符串资源详述
字符串资源使用方法详解 工具:Pycharm python环境:anaconda 接下来开始逐一解释: 如图: test后敲个点,就可以调用框框内的所有函数(功能),典型的面向对象思想. 上面只是简单 ...
- 使用RobotFramework的JavaRemoteLibrary
终于被迫使用了Java的远程接口库(为了同时使用Java和python的用例库,且为了在pybot下跑速度能快一些),路途比实际想的要坎坷,记录下来. 远程库的原理在前边一篇文章中记录过: http: ...
- wtforms 钩子函数
参考: https://www.cnblogs.com/wupeiqi/articles/8202357.html class LoginForm(Form): name = simple.Strin ...
- Go Web 编程之 数据库
概述 数据库用来存储数据.只要不是玩具项目,每个项目都需要用到数据库.现在用的最多的还是 MySQL,PostgreSQL的使用也在快速增长中. 在 Web 开发中,数据库也是必须的.本文将介绍如何在 ...
- PPT制作简易套路指南
最近正在重做公众号相关的一些设计以及排版,想到年前部门里的UI设计大神做了一个关于"PPT设计指南"的分享,正好可以拿来实践一把. 一直以来,PPT.Word.Excel都是办公人 ...
- Integer梳理
Integer常量池 问题1 public class Main_1 { public static void main(String[] args) { Integer a = 1; Integer ...
- UML--> plantUML安装
plantUML安装 因为基于intellid idea,所以第一步自行安装. setting->plugins 搜索plantUML 安装完成后,重启idea 会有如下显示 安装Graphvi ...