我在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&amp;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的更多相关文章

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

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

  3. SpringBoot项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

    .   ____          _            __ _ _ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \( ( )\___ | '_ | '_| | ...

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

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

  5. springboot启动报错:Cannot determine embedded database driver class for database type NONE.

    package cn.zb.test; import org.springframework.boot.SpringApplication; import org.springframework.bo ...

  6. spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE

    最近在学习使用spring boot.使用maven创建好工程,只引用需要用到的spring boot相关的jar包,除此之外没有任何的配置. 写了一个最简单的例子,如下所示: package com ...

  7. springboot项目启动报错

    启动springboot项目报错: NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter ...

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

  9. springboot项目启动报错Communications link failure

    环境情况,MySQL版本如下: 报错情况如下(看上去是和数据库有关): com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communi ...

随机推荐

  1. 对一个前端使用AngularJS后端使用ASP.NET Web API项目的理解(2)

    chsakell分享了一个前端使用AngularJS,后端使用ASP.NET Web API的项目. 源码: https://github.com/chsakell/spa-webapi-angula ...

  2. 一个简单例子理解C#的协变和逆变

    关于协变逆变,SolidMango的解释是比较可取的.有了协变,比如,在需要返回IEnumerable<object>类型的时候,可以使用IEnmerable<string>来 ...

  3. Mybatis-Plus 多表联查分页

    原文:https://www.jianshu.com/p/759b6430ed5b 分析 使用的工程,依旧是 spring-boot,关于分页,官网给出了一个单表的 demo,其实多表分页实现原理相同 ...

  4. App.config和Web.config配置文件的配置节点的解析

    前言 在http://www.cnblogs.com/aehyok/p/3558661.html这篇博文中,大致对配置文件有了初步的了解,并且在文中有提到过<appSettings>和&l ...

  5. ExtJS 4.2 教程-03:使用Ext.define自定义类

    转载自起飞网,原文地址:http://www.qeefee.com/extjs-course-3-define-classes ExtJS 4.2 教程-01:Hello ExtJS ExtJS 4. ...

  6. bash 设置

    export COLUMNS=500 $* 将所有命令行参数当做单个文本值包含 $@ 将所有命令行参数当做独立的文本值包含 $# 命令行参数数目 $? 最近使用的前端进程的退出状态码 $- 当前命令选 ...

  7. Eclipse SDK Android Studio 下载地址

    https://developer.android.com/sdk/index.html#download 这个网址可以下载需要的东西,FQ的话可以给 xifulinmen@gmail.com 发一个 ...

  8. Redis 性能问题的记录

    最近线上使用redis, 查询的情况不甚理想, 这个查询操作是个 lua 脚本, 包含如下操作 开发机 redis, 没有其他干扰, 插入的 zset 有 5000 member 左右, 使用的 re ...

  9. delete method not allowed 405错误

    造成该问题的原因:iis版本问题 解决办法如下: 修改配置文件web.config <system.webServer><modules><remove name=&qu ...

  10. hyper-v 用户无法再 创建外部配置存储 0x80070005

    windows server 2008R2 刚安装的hyper-v 重启过. 修改配置文件到d:\Hyper-V目录下, hyper-V 创建 服务器遇到错误 操作失败 创建外部配置存储:一般性拒绝访 ...