今天Spring Boot 2.0正式版发布,寻思着搭个小demo尝试一下Spring Boot的新特性,使用idea创建项目。在选择组件时添加了mysql、mybatis 然后在第一次启动的时候启动报错,错误信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-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).

在多方查证后,需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude

= {DataSourceAutoConfiguration.class},排除此类的autoconfig。启动以后就可以正常运行。

这是因为添加了数据库组件,所以autoconfig会去读取数据源配置,而我新建的项目还没有配置数据源,所以会导致异常出现。

SpringBoot2 启动报错 Failed to auto-configure a DataSource的更多相关文章

  1. 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 创建 ...

  2. libvirt启动报错Failed to start Virtualization daemon

    libvirt启动报错Failed to start Virtualization daemon 1.启动libvirt的具体报错如下 [root@localhost IOS]# service li ...

  3. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

  4. Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource

    *************************** APPLICATION FAILED TO START *************************** Description: Fai ...

  5. SpringBoot启动报错Failed to determine a suitable driver class

    SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...

  6. Eclipse启动 报错[Failed to load the JNI shared library jvm.dll

    准备要做java服务器,在安装开发环境时,启动Eclipse报错[Failed to load the JNI shared library jvm.dll] 研究了下,造成错误的原因是由于eclip ...

  7. 新建Spring boot 启动报错 Failed to auto-configure a DataSource

    今天学习springboot,使用idea创建项目.在选择组件时添加了mysq 然后在第一次启动的时候启动报错,错误信息如下: ***************************APPLICATI ...

  8. springboot启动报错Failed to configure a DataSource

    2018-11-21 19:43:12.076 WARN 5392 --- [ main] ConfigServletWebServerApplicationContext : Exception e ...

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

随机推荐

  1. 最全PyCharm教程

    最全PyCharm教程--for python PyCharm简介: PyCharm是由JetBrains打造的一款Python IDE,VS2010的重构插件Resharper就是出自JetBrai ...

  2. 解决iPad/iPhone下手机号码会自动被加上a标签的问题

    解决办法: 在页面顶部<head></head>中增加: <meta name="format-detection" content="te ...

  3. 搭建Dubbo+Myeclipse2015+Maven3.3.1的过程遇到问题集锦

    1. 找不到dubbo2.8.4包的问题 在编译Maven工程的过程中,出现如下问题: Description Resource Path Location Type ArtifactDescript ...

  4. javaweb下载文件

    //读取文件->写出文件 public static void main(String[] args) { InputStream in =null; OutputStream out = nu ...

  5. 【Unity】9.1 导入粒子系统组件

    分类:Unity.C#.VS2015 创建日期:2016-05-02 一.简介 Unity 5.x已经自带了粒子系统组件,新建工程后只需要直接导入它就可以使用了. 二.导入Unity自带的粒子系统组件 ...

  6. 深入浅出HTTPS基本原理

    基础知识准备:在了解HTTPS的基本原理之前,需要先了解如下的基本知识. 一.什么是HTTPS,TLS,SSL HTTPS,也称作HTTP over TLS.TLS的前身是SSL,TLS 1.0通常被 ...

  7. K8S 详细介绍

    k8s的中文文档,参考地址:http://docs.kubernetes.org.cn/227.html

  8. haproxy-1.7.7 基于域名的调度配置

    配置样列: [root@c01 haproxy-1.7.7]# cat conf/haproxy.cfg global log 127.0.0.1 local0 info #[err warning ...

  9. HTML5学习笔记(九):选择器详解

    在前面的笔记中我们已经接触过几种常见的选择器,本笔记我们将深入了解CSS的选择器. 元素选择器 最常见的 CSS 选择器是元素选择器.换句话说,文档的元素就是最基本的选择器.在 W3C 标准中,元素选 ...

  10. BleedTree动画混合树[Unity]

    Unity在中土大陆的大肆推广能从广泛的中文翻译资料中看出.所以,手册才是王道. 游戏动画中的一个常见任务是在两个或更多相似运动之间混合.最佳的已知示例可能是根据角色速度混合行走和奔跑动画.另一个示例 ...