错误原因

在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. 易语言json

    1.易语言助手  ->网页功能->网页调试 打开post工具 提交协议头里面 右键可以自定义默认的十几个ua头 2.项目爬模发送数据格式为[{},{},{},{}]  相当于没有键 只有值 ...

  2. 93、springboot 和springcloud版本对比

    https://start.spring.io/actuator/info 建议转为json

  3. Codeforces Round #781 (Div. 2) - D. GCD Guess

    GCD + 位运算 [Problem - 1665D - Codeforces](https://codeforces.com/problemset/problem/1627/D) 题意 交互题,有一 ...

  4. C++的mfc创建管道

    注意:下面的东西是单管道 //创建管道 CString CDownDlg::CreateCmd(CString res) { CString wrCmd; CString ans = _T(" ...

  5. MAC截图快捷键有哪些?

    在日常办公的时候,在遇到问题的时候使用截图会比打字方便的多,因为使用最频繁的是Windows系统,所以习惯用windows的截图快捷键进行截图.这时你会发现在MAC中这些快捷方式都是无效的,那么MAC ...

  6. Docker--搭建 Gitlab 容器并上传本地项目代码

    本文参考:https://www.cnblogs.com/poloyy/p/13969756.html 搭建 Gitlab 容器 搜索 gitlab 镜像 docker search gitlab 创 ...

  7. while read line 中使用ssh只能读取一行

    问题:while read line 中使用ssh只能读取一行? #!/bin/sh while read line do echo $line ssh root@$line "echo 1 ...

  8. IDEA打包普通java项目并用java命令运行

    IDEA下打包为jar包,普通java项目(非web项目) 效果是将第三方jar包放到一个文件夹中(如lib),这样看起来清晰一些.如下图这种: 1.项目结构. 1.关键:modules 在<o ...

  9. Redis集群(主从复制)

    主从复制主从复制原理 Redis集群中有很多Redis服务器,这些Reids服务器分为主服务器和从服务器. 从服务器会向主服务器发送命令:SYNC命令. 主服务器接收到SYNC命令后,开始执行GBSA ...

  10. RabbitMQ宕机了怎么办?

    RabbiMQ宕机会导致消息丢失! 解决办法:可以做消息持久化. 非持久化消息:只有非持久化消息在RabbitMQ宕机时会发生消息丢失. 持久化消息:持久化的消息会在接收后被保存到磁盘中,所以Rabb ...