Spring Boot报 Action: Consider the following: If you want an embedded database (H2, HSQL or Derby)...

项目启动报错:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H... 阅读详情

异常:

        Spring Boot项目启动不成功报


Description:
 
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
 
Reason: Failed to determine a suitable driver class
 
 
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 need to activate it (no profiles are currently active).

首先检查生成的 target 文件中是否包含了你在resources 中编写的的配置文件 application.yml等等,若没有包含,而你的项目中却需要调用就会报此异常,你可以添加以下代码至pom.xml中。里面的.properties可以视你的配置文件后缀名所定。

  <build>
    <!--idea  识别.xml  指定资源的位置-->
    <resources>
      <resource>
        <directory>src/main/java</directory><!--所在目录-->
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
        <filtering>false</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory><!--所在目录-->
        <includes>
          <include>**/*.yml</include>
          <include>**/*.xml</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>
  </build>

再者还有可能是因为spring boot 会默认加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration这个类,而DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean,又因为项目(eureka-server模块和短信模块)中并没有关于dataSource相关的配置信息,所以当spring创建dataSource bean时因缺少相关的信息就会报错。

解决方法就是在启动类头上加行代码。

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class SpringBootApplication {
 
    public static void main(String[] args) {
        SpringApplication.run(SpringBootApplication.class, args);
    }
}

U-Boot 适配新型号 SPI Nor Flash 实战解析 本文详细解析了U-Boot适配新型号SPI Nor Flash的全过程,从JEDEC ID识别错误入手,深入源码分析Flash信息数据库,结合实际手册参数添加新设备支持。重点介绍了设备树同步和验证调试的关键步骤,并总结了常见问题与解决方案,为嵌入式开发者提供实用参考。 阅读详情

相关推荐

工程师职级胜任力框架

一、前言 尽管这些年国内的IT行业发展迅速,但是仍然欠缺一套比较综合性的面向工程师的职级胜任力框架,造成国内很多工程师大都一心只想成为技术大牛,而忽视了自己全方位的工程师职业素养和能力的培养。 最近我有幸读到了Circle CI公司分享的工程胜任力矩阵,发现这份文档就是一份比较贴合互联网研发型企业的工程师职级胜任力框架,于是我在它的基础上,重新整理出了一份更适合国内工程师阅读的《工程师职级胜任力框架》,并把它分享在波波的github站点上,希望这份文档对工程师的职业开发和成长有帮助。注,Circle CI.

架构师波波的专栏 6332

Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the

*************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable dr

m0_61849361的博客 2万+

从零部署奥比中光Gemini335L:Python SDK编译与手眼标定环境实战

本文提供了一份从零部署奥比中光Gemini 335L深度相机的完整实战指南。详细介绍了驱动安装、Python SDK编译、CMake配置及虚拟环境搭建等关键步骤,并重点解析了如何通过编译生成Python模块,最终实现深度图与点云数据获取,为后续的机械臂手眼标定工作奠定坚实基础。

weixin_29031161的博客 399

报错:Consider the following: If you want an embedded database (H2, HSQL or Derby)

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

weixin_53259317的博客 6972

最新测算源码PHP算命源码-风水八字-八字起名-塔罗牌占卜

未来,随着技术的发展和用户需求的变化,我们可以继续对系统进行升级和优化,以满足更多用户的需求和期望。数据库设计:创建一个名为bazi的数据库表,包含以下字段:id(自增ID)、name(姓名)、sex(性别)、birth_date(出生日期)、birth_time(出生时间)、bazi(八字结果)。数据库设计:创建一个包含塔罗牌信息的数据库表,如tarot_cards,包含字段:id(塔罗牌ID)、name(塔罗牌名称)、meaning(塔罗牌含义)等。根据操作系统的不同,PHP的安装方法会有所不同。

shanbeizi的博客 2420

从AND到XOR:5种门控电路在PrimeTime中的检查策略差异

本文深入探讨了AND、NAND、OR、NOR和XOR五种门控电路在PrimeTime静态时序分析中的检查策略差异。重点解析了XOR门控因其非单调性而无法被工具自动推断,需要工程师手动配置的特殊性,并提供了针对各类门控的配置模板与调试技巧,以确保时钟网络的完整性与芯片设计的可靠性。

rgv2345678的博客 270

Consider the following: If you want an embedded database (H2, HSQL or Derby)

启功SpringBoot项目时报错,问题描述如下: 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 need to activate it (no profiles are cur

qq_44440275的博客 9357

Android车载音频系统概览

官网有些部分的内容描述比较简单,对没有app、系统和底层开发经验,容易一眼扫过,没有留意到相关细节。 本节补充车载音频相关细节。

hwj的博客 785

Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i..

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

lwj1433223的博客 1万+

7 中望CAD二次开发-标注(一)(ZRX C++)

尺寸标注是CAD设计中最常用的功能之一,软件内置了很多标注功能,可以通过使用这些标注工具,对需要标注的长度、角度等一个个进行标注。但这显然效率很低,学习CAD二次开发,就是要把人从重复的劳动中解放出来,实现批量标注。本文介绍,如何通过二次开发进行标注。

cilvsuanna的博客 339

PrimeTime low power-多电压设计流程(2)

get_power_switches`、`get_supply_nets` 和 `get_supply_ports` 命令的操作方式类似,并具有类似的命令选项。PrimeTime 根据 UPF 命令构建电源供应网络,包括 create_power_domain、create_supply_net、create_supply_set、create_supply_port、set_domain_supply_net 和 connect_supply_net。电源集句柄是为电源域隐式创建的一个抽象电源集。

QRBQ 712

解决Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), ple..

问题 springboot异常Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i… ** 解释: **在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSo

技术分享,共同进步 7294

某瓜数据app 获取达人直播商品信息接口 Sign

某瓜数据app 获取达人直播商品列表接口 Sign

自成背后的博客 6039

Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i...

错误原因 在pom中引入了mybatis-spring-boot-starter ,Spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource ...

weixin_30778805的博客 2万+

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

项目报错Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on

写项目的时候遇到报错信息 Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded d

Andanc的博客 3681

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

bug---springboot报错Consider the following: If you want an embedded database (H2, HSQL

错误描述 Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i 原因 在idea创建springboot项目(配置springboot initializer)时勾选了springboot data.,mysql driver这些数据库有关的组件后,并未配置连接信息就启动了springgboot项目 解决 配置连接参数 ...

qw160的博客 1006

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i.

问题处理

m0_47943986的博客 362

【异常】SpringBoot3.2.0 Description: Failed to configure a DataSource: ‘url‘ att

spring-boot3 使用以下依赖。mybatisPlus 多数据源导致。

我是Superman丶的博客 537

Spring boot 启动报错-Reason Failed to determine a suitable driver class

在不需要配置数据源(例如MySQL数据库)的情况下,启动异常:  ***************************  APPLICATION FAILED TO START  *************************** Description: Failed to configure a DataSource: no embedded datasource could be...

qq_42422787的博客 670

[springboot 初学] 之第一次创建工程报的错误

springboot的好处不bb了, 直接写流程创建有三种方式:eclipse intelliJ 或者 点击这里创建 。eclipse需要安装spring的插件才能创建 具体叫啥忘了。。。。自行百度吧创建好之后目录结构:pom文件:&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.apache....

王sir的博客 863

开发者警惕:别让高频AI聊天取代你的问题定位能力

大语言模型驱动的AI聊天工具,正在成为开发者日常编码中的高频协作者。其本质是基于海量文本的概率生成,而非真正的逻辑推理,因此擅长概念解释、模板代码生成和信息速查,却在版本兼容、运行环境验证上存在天然边界。当开发者习惯于将报错粘贴给AI,并直接采纳答案时,问题定位路径被压缩,知识体系趋于碎片化,安全验证环节也容易被跳过。正确的实践是将AI视为“加速器”而非“替身”:先自主梳理思路、提供完整上下文、设计清晰的Prompt,再让AI辅助验证与补充。本文从工程实践角度,结合Spring Boot调试案例,探讨如何平

weixin_30388677的博客 284

Consider the following: If you want an embedded database (H2, HSQL or Der...

这个坑把java进程干掉就可以了,因为占用了 Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.//无法配置数据库,没有指定url属性,并且无法配置embedded datasource...

weixin_42981419的博客 5812

报错[已解决]:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

报错[已解决]:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.(SpringBoot连接数据库) Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. ...

m0_51660523的博客 4万+
上一篇: Spring Boot单元测试
下一篇: Invalid bound statement (not found): 各种原因
We Never say die
博客等级 码龄7年 12粉丝 31原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

We Never say die

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值