错误原因

在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。

解决错误

在Spring boot的启动引导类上增加属性@SpringBootApplication(exclude = DataSourceAutoConfiguration.class),即可阻止Spring boot自动注入dataSource

————————————————

版权声明:本文为CSDN博主「bug开发师」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/lwj1433223/article/details/108000303

Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.的更多相关文章

  1. Spring boot 启动错误处理: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...

    错误原因 在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoconfigure.jdb ...

  2. 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 ne

    更多精彩关注微信公众号 错误原因 在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoc ...

  3. SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-004-使用NamedParameterJdbcTemplate

    为了使查询数据库时,可以使用命名参数,则要用NamedParameterJdbcTemplate 1.Java文件配置 @Bean public NamedParameterJdbcTemplate ...

  4. SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-003-四种方式获取DataSource

    一.概述 1.Spring offers several options for configuring data-source beans in your Spring application, i ...

  5. SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-002-本章的源代码

    0.结构 一.JDBC层 1. package spittr.db; import java.util.List; import spittr.domain.Spitter; /** * Reposi ...

  6. SPRING IN ACTION 第4版笔记-第十章Hitting the database with spring and jdbc-001-Spring对原始JDBC的封装

    1.spring扩展的jdbc异常 2.Template的运行机制 Spring separates the fixed and variable parts of the data-access p ...

  7. springboot 的部分细节

    Application.properties 中#指定端口号 server.port= #指定访问路径必须以/crud/xxx 开始 server.servlet.context-path=/crud ...

  8. SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embe

    问题描述 *************************** APPLICATION FAILED TO START *************************** Description ...

  9. If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

    学习Spring Boot 过程中遇到了下列这个问题 Description: Failed to configure a DataSource: 'url' attribute is not spe ...

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

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

随机推荐

  1. List集合转换成数组

    我现在有个需求:将File集合转换成MultipartFile数组结构 然后我就开始在网上开启了List转换到数组之旅. 首先来看一个例子 ArrayList<String> list=n ...

  2. UntrimmedNets for weakly supervised action recognition and detection概述

    0.前言 相关资料: 论文 github 论文解读(CSDN) 论文基本信息: 领域:动作识别与检测 发表时间:CVPR2017(2017.5.22) 1.针对的问题 这篇论文之前的行为识别方法严重依 ...

  3. linux发展史及软件配置

    linux岗位需求 # 1.岗位需求 自动化运维,容器运维,DBA,IDC运维(不建议) ps:linux岗位会的越多给的越多 linux工作本质 linux简要发展史 # 1.发展 1991年,芬兰 ...

  4. 在linux环境中安装node,npm,express

    linux安装node 连接运程命令: 进入usr/local 文件夹 cd /usr/local 1.下载 wget https://nodejs.org/dist/v14.17.6/node-v1 ...

  5. Echarts xAxis、yAxis

    2017年08月06日 09:10:12 数据架构师 阅读数:37641更多 所属专栏: Echarts数据可视化    版权声明:本文为博主原创文章,转载请注明来源.开发合作联系82548597@q ...

  6. 记录aop失效问题

    例子:转账demo 使用技术:基于注解的方式实现,aop也是通过注解实现(Spring) 出现问题:aop已经写好,但是没有生效 原因:1.切入点是否正确(不是本问题) 2.基于注解方式实现,没有配置 ...

  7. 使用jquery+layui 做一个输入搜索下拉 类似lay-search

    效  果: 因为需要做一个搜索出现下拉然后点击 自动填装input 内容的 东西. 一开始使用lay-search 的控件去弄. 但是无法控制里面的内容.所以用了一些笨方法去弄 废话不说了, html ...

  8. RN 使用react-native-video 播放视频(包含进度条、全屏)

    21年12月3日,阐述上有问题:应该将问题拆分,不该将代码整一大堆,看着很不舒适 目标需求:1. 实现视频播放 2. 进度条 3. 进入全屏 目标图是这样的: 需要三个组件 1. 播放视频组件, re ...

  9. 关于Easyui和JQuery版本兼容IE8问题记录

    1.最后支持IE8及以下版本的是JQuery1.9 2.最后支持IE8及以下的Easyui是1.3.2,其对应的是JQuery1.8 因为低版本的Easyui,缺少某些方便好用的属性方法和样式不好看, ...

  10. 05 RDD练习:词频统计

    一.词频统计: 1.读文本文件生成RDD lines 2.将一行一行的文本分割成单词 words flatmap() 3.全部转换为小写 lower() 4.去掉长度小于3的单词 filter() 5 ...