错误原因

在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数组转List

    List<Person> list = obj.list.ToObject<List<Person>>()

  2. knife4j 整合springboot

    1.添加依赖 <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife ...

  3. .NET 7介绍及环境准备

    环境要求 VS2022 17.4+

  4. java-正确打日志

    使用 slf4j 使用门面模式的日志框架,有利于维护和各个类的日志处理方式统一. 实现方式统一使用: Logback 框架 打日志的正确方式 什么时候应该打日志 当你遇到问题的时候,只能通过 debu ...

  5. 041_Record Type

    应用场景:在使用Apex新建记录时,有时需要根据具体需求为用户匹配对应的记录类型,这个时候就需要用到记录类型Id的情况. 获取RecordTypeId的方法有2种,一种是根据soql进行查询,另一种是 ...

  6. Morris遍历以及Morris前序中序后序遍历实现

    #include<iostream> using namespace std; struct TreeNode{ int val; TreeNode* right; TreeNode* l ...

  7. nginx 添加ssl认证,访问静态资源 笔记

    1.查看是否开启SSL模块, /usr/local/nginx/sbin    ./nginx  -V 2.没有开启,进入到nginx源码包目录下: 3编译 ./configure --prefix= ...

  8. 项目实训DAY7

    今天与昨天一样,查论文,并美化了一下功能界面的样式.

  9. AX2012 查询用户在线操作记录

    1 static void ExportSysClientAccessLog(Args _args) 2 { 3 SysClientAccessLog sysClientAccessLog; 4 5 ...

  10. jenkins - Asp.net 环境搭建(Windows)

    jenkins - Asp.net 环境搭建(Windows) 安装环境 通过 Chocolatey自动安装 choco install ojdkbuild11 #或 choco install jd ...