Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE
我在springboot项目里面引入了数据库的配置:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
然后启动项目的时候报错,提示的错误信息为Cannot determine embedded database driver class for database type NONE
这是因为spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。
修改application.properties配置文件,添加数据库配置信息:
#jdbc configuration
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/employees?useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
重新启动Springboot,就可以正常启动了。
Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE的更多相关文章
- 【spring cloud】【spring boot】项目启动报错:Cannot determine embedded database driver class for database type NONE
解决参考文章:https://blog.csdn.net/hengyunabc/article/details/78762097 spring boot启动报错如下: Error starting A ...
- 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项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | ...
- SpringBoot启动报错Failed to determine a suitable driver class
SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...
- springboot启动报错:Cannot determine embedded database driver class for database type NONE.
package cn.zb.test; import org.springframework.boot.SpringApplication; import org.springframework.bo ...
- spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
最近在学习使用spring boot.使用maven创建好工程,只引用需要用到的spring boot相关的jar包,除此之外没有任何的配置. 写了一个最简单的例子,如下所示: package com ...
- springboot项目启动报错
启动springboot项目报错: NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter ...
- 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项目启动报错Communications link failure
环境情况,MySQL版本如下: 报错情况如下(看上去是和数据库有关): com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communi ...
随机推荐
- 阅读Linux内核源码时建立tags索引
比如在阅读arm架构的Linux内核代码时想建立arm架构相关的索引,可以使用下面的命令: make ARCH=arm tags
- AutoMapper在MVC中的运用05-映射中的忽略、处理null、多种映射转换
本篇AutoMapper使用场景: ※ 动态实现接口方法或属性 ※ 目标中的属性如果比源多,可以忽略多出的属性 ※ 目标有virtual属性,可忽略 ※ 目标属性值为null的解决办法 ※ int转s ...
- h股和L股
- Unity3D 中鼠标按下时OnMouseDown()、Input.GetMouseButtonDown()和EventType.MouseDown的响应验证
初学unity3D,对于其中的事件响应不是很清楚,于是写了下面的代码来验证: 1.新建.cs文件,名为testMouse.cs: using UnityEngine; using System.Col ...
- 【转】Android开发在路上:少去踩坑,多走捷径
本文是我订阅"腾讯大讲堂"公众帐号时,他们推送的一篇文章,但在腾讯大讲堂官网上我并没有找到这篇文章,不过其它专门"爬"公众号文章的网站倒是有.我觉得写的很不错. ...
- LINQ to XML 建立,读取,增,删,改
LINQ to XML的出现使得我们再也不需要使用XMLDocument这样复杂的一个个的没有层次感的添加和删除.LINQ可以使的生成的XML文档在内存中错落有致.下面以一个小的例子说名LINQ ...
- BZOJ3328: PYXFIB
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3328 题解:关键在于只处理i%k的项,那么我们就需要用一个式子来表达这个东西. p%k==1. ...
- SCRIPT5009: “Sys”未定义 部署.net ajax 解决方案
今天在部署asp.net ajax 的时候发现部署服务器的时候,ajax刷新不正确,开始以为是System.Web.Extensions没有引用到本地,baidu一圈发现(最近google上不了郁闷~ ...
- Reboot server stuck at “Press ESC in 1 seconds to skip startup.nsh”
I have a Cisco C240 server, and everytime after reboot, it will got stuck at screen like below. To r ...
- OC-字符串中大小写字母转换
一般语言中的大小写转换都会提供的有默认的函数,不过闲来无事,简单的模仿实现了一下: 系统中默认的大小写转换: NSString *name=@"博客园-FlyElephant"; ...