Description:

Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-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)

(一) 、启动时不需要数据源加载,但加载了数据源,数据源获取失败,异常报错,启动失败。

解决方法:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//去掉数据源
public class MySpringBootApplication { public static void main(String[] args) { SpringApplication.run(MySpringBootApplication.class,args);
}
} (二)、有数据源依旧报错,配置文件没有加载成功
可以尝试在pom.xml文件的build标签中加入如下内容:
<resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>

SpringBoot 启动失败 Failed to determine a suitable driver class 问题解决方案的更多相关文章

  1. Springboot 抛出Failed to determine a suitable driver class异常原因

    SpringBoot项目,已经依赖了MySQL驱动,却还是无法启动,通过问题排除,如果是启动项目,那么pom值 <packaging>pom</packaging> Faile ...

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

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

  3. springboot启动不能加载数据库驱动Failed to determine a suitable driver class

    SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/G:/sharp/repo ...

  4. jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

    java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.conte ...

  5. 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 消费者提示需要配置数据源

    使用 由于给前端做分页 在启动消费者的时候遇到了这个问题 Failed to configure a DataSource: 'url' attribute is not specified and ...

  6. 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

    解决方案: @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) 作用://取消数据库配置 但是 在用到数据库的时候记 ...

  7. 关于idea中SpringBoot启动失败的坑

    很多时候你新建了Maven 或者SpringBoot 工程,激动的点了主启动类,你就发现了下面的错误 Error starting Tomcat context. Exception: org.spr ...

  8. springboot启动失败( No active profile set, falling back to default profiles: default)

    问题: springboot启动失败( No active profile set, falling back to default profiles: default) 解决方法 在pom.xml文 ...

  9. Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE

    Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...

随机推荐

  1. luogu 1072 Hankson 的趣味题 唯一分解定理+线性筛

    貌似是比大多数题解优的 $O(n^2logn)$ ~ Code: #include <bits/stdc++.h> #define N 50004 #define setIO(s) fre ...

  2. python中的位运算

    目录 1.判断奇偶数 2.交换两个数 3.找出没有重复的数 4.3的n次方 5. 找出不大于N的最大的2的幂指数 1.判断奇偶数 如果把n以二进制形式展示的话,我们只需要判断最后一个二进制位是1还是0 ...

  3. 你知道 GNU Binutils 吗?【binutils】

    概述 从事 Linux 开发的朋友们都不可避免地用到一些工具,比如 objcopy.nm.objdump.readelf 等等.其实这一系列的工具,就是所谓的 Binutils,当然 GNU 就表示它 ...

  4. TypeScript----数据类型

    TypeScript 简介 TypeScript 由 Microsoft开发和维护的一种开源编程语言.它支持 JavaScript 的所有语法和语义,同时通过作为 ECMAScript 的超集来提供一 ...

  5. [CSP-S模拟测试]:Weed(线段树)

    题目描述 $duyege$的电脑上面已经长草了,经过辨认上面有金坷垃的痕迹.为了查出真相,$duyege$准备修好电脑之后再进行一次金坷垃的模拟实验.电脑上面有若干层金坷垃,每次只能在上面撒上一层高度 ...

  6. Python最高效爬虫框架

    Overview Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websi ...

  7. CSS效果篇--这里有你想要的CSS3漂亮的自定义Checkbox各种复选框

    在原来有一篇文章写到了<CSS效果篇--纯CSS+HTML实现checkbox的思路与实例>.这篇文章主要写各种自定义的checkbox复选框,实现如图所示的复选框: 大致的html代码都 ...

  8. IDEA项目里Maven 的Plugins出现红线的解决方法

    1.删除项目里的libraries(快捷键ctrl+shift+alt+s):Project Settings->Libraries,全选删除 2.删除之前项目产生的target 3.然后再in ...

  9. dubbo的实现原理

    dubbo的介绍 dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架,使得应用可通过高性能的RPC实现服务的输出和输入功能,可以和Spring框架无缝集成. dubbo框架是基于Spring容器运 ...

  10. PHP ob_get_level嵌套输出缓冲

    PHP的输出缓存是可以嵌套的.用ob_get_level()就可以输出嵌套级别. 测试发现在cli和浏览器下输出结果不一样(PHP5.4). ob_level1.png手册说明如下: ob_get_l ...