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. codevs 2924 数独挑战 x(三种做法+超详细注释~)

    2924 数独挑战  时间限制: 1 s  空间限制: 1000 KB  题目等级 : 钻石 Diamond   题目描述 Description “芬兰数学家因卡拉,花费3个月时间设计出了世界上迄今 ...

  2. zabbix自动注册,实现自动添加机器,减少人工干预

    1.zabbix_agent的安装配置: vim install_zabbix_agent.sh #!/bin/bash #author:chenjianwen RealIP=`curl -s htt ...

  3. Python基础之Python语言类型

    编程语言主要从以下几个角度进行分类: 编译型和解释型 静态语言和动态语言 强类型定义语言和弱类型定义语言 编译和解释的区别是什么? 编译器把源程序的每一条语句都编译成机器语言,并保存成二进制文件,这样 ...

  4. AtCoder AGC014E Blue and Red Tree (启发式合并)

    题目链接 https://atcoder.jp/contests/agc014/tasks/agc014_e 题解 完了考场上树剖做法都没想到是不是可以退役了... 首先有一个巨难写的据说是\(O(n ...

  5. js移动端触屏事件

    移动端触屏滑动的效果其实就是图片轮播,在PC的页面上很好实现,绑定click和mouseover等事件来完成.但是在移动设备上,要实现这种轮播的效果,就需要用到核心的touch事件.处理touch事件 ...

  6. 测试linux服务器是否能接入微信

    官方文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421135319 php.代码 <?php $a = $_GE ...

  7. VI快捷键速记

    enjoy :P

  8. rocketmq 以广播方式实现消费者消费消息

    package com.bfxy.rocketmq.model; import java.util.List; import org.apache.rocketmq.client.consumer.D ...

  9. 最简SpringBoot程序制法

    JDK:1.8.0_212 IDE:STS4(Spring Tool Suit4 Version: 4.3.2.RELEASE) 工程下载:https://files.cnblogs.com/file ...

  10. [eclipse]如何修改Eclipse编辑器的字体

    步骤如下, 菜单->"Window"->“Preference”->“General”->“Appearance”->“Colors & Fo ...