SpringBoot2 启动报错 Failed to auto-configure a DataSource
今天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的更多相关文章
- 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 创建 ...
- libvirt启动报错Failed to start Virtualization daemon
libvirt启动报错Failed to start Virtualization daemon 1.启动libvirt的具体报错如下 [root@localhost IOS]# service li ...
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
- Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource
*************************** APPLICATION FAILED TO START *************************** Description: Fai ...
- SpringBoot启动报错Failed to determine a suitable driver class
SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...
- Eclipse启动 报错[Failed to load the JNI shared library jvm.dll
准备要做java服务器,在安装开发环境时,启动Eclipse报错[Failed to load the JNI shared library jvm.dll] 研究了下,造成错误的原因是由于eclip ...
- 新建Spring boot 启动报错 Failed to auto-configure a DataSource
今天学习springboot,使用idea创建项目.在选择组件时添加了mysq 然后在第一次启动的时候启动报错,错误信息如下: ***************************APPLICATI ...
- springboot启动报错Failed to configure a DataSource
2018-11-21 19:43:12.076 WARN 5392 --- [ main] ConfigServletWebServerApplicationContext : Exception e ...
- 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 ...
随机推荐
- nexus7 1代 刷4.2.2+root[转]
下面和大家分享一下刷机方法.(该刷机方法根据论坛有小改动)刷机前记得备份...刷机前准备:一.准备工具1.N7电脑驱动(usb_driver_r06_windows.zip)2.刷机工具(N7 fas ...
- PHP百分号转小数,php 小数转换百分数函数
PHP百分号转小数: <?php $a = "20.544545%"; echo (float)$a/100; ?> php 小数转换百分数函数: function x ...
- ( ̄▽ ̄)" 关于河北ETC记账卡的默认密码
去营业厅问了下,是6个1(111111),一般人我不告诉他 ...( _ _)ノ| 好吧,在技术博客里发这种东西合适吗? 还有就是,如果需要打印单位抬头发票的话,需要携带委托书盖单位公章(委托书可以去 ...
- 关于Eclipse如何加入Gradle文件与Android Studio两个平台一起开发,工作目录不发生变化
前言: 本来很久之前想弄这玩意,不过因为各种原因,所以没弄. 今天有位前辈提出需求.说想让Eclipse的Android项目逐步走向Android Studio,但是又担心Android Studio ...
- Atitti python2.7安装 numpy attilax总结
Atitti python2.7安装 numpy attilax总结 1.1. easy_install 安装模式,没有 easy_install ,先手动安装1 1.2. 安装setuptools ...
- 【Unity】4.3 地形编辑器
分类:Unity.C#.VS2015 创建日期:2016-04-10 一.简介 Unity拥有功能完善的地形编辑器,支持以笔刷绘制的方式实时雕刻出山脉.峡谷.平原.高地等地形.Unity地形编辑器同时 ...
- PxCook(像素大厨)
PxCook(像素大厨)是一款切图设计工具软件.自2.0.0版本开始,支持PSD文件的文字,颜色,距离自动智能识别. 优点在于将标注.切图这两项设计完稿后集成在一个软件内完成,支持Windows和Ma ...
- python实现tail -f功能
这篇文章最初是因为reboot的群里,有人去面试,笔试题有这个题,不知道怎么做,什么思路,就发群里大家讨论 我想了一下,简单说一下我的想法吧,当然,也有很好用的pyinotify模块专门监听文件变化, ...
- golang 解决 TCP 粘包问题
什么是 TCP 粘包问题以及为什么会产生 TCP 粘包,本文不加讨论.本文使用 golang 的 bufio.Scanner 来实现自定义协议解包. 协议数据包定义 本文模拟一个日志服务器,该服务器接 ...
- prometheus-dashboard-to-grafana
https://prometheus.io/docs/visualization/grafana/ https://www.digitalocean.com/community/tutorials/h ...