SpringBoot 启动失败 Failed to determine a suitable driver class 问题解决方案
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 问题解决方案的更多相关文章
- Springboot 抛出Failed to determine a suitable driver class异常原因
SpringBoot项目,已经依赖了MySQL驱动,却还是无法启动,通过问题排除,如果是启动项目,那么pom值 <packaging>pom</packaging> Faile ...
- SpringBoot启动报错Failed to determine a suitable driver class
SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...
- springboot启动不能加载数据库驱动Failed to determine a suitable driver class
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/G:/sharp/repo ...
- jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.conte ...
- 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 ...
- 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) 作用://取消数据库配置 但是 在用到数据库的时候记 ...
- 关于idea中SpringBoot启动失败的坑
很多时候你新建了Maven 或者SpringBoot 工程,激动的点了主启动类,你就发现了下面的错误 Error starting Tomcat context. Exception: org.spr ...
- springboot启动失败( No active profile set, falling back to default profiles: default)
问题: springboot启动失败( No active profile set, falling back to default profiles: default) 解决方法 在pom.xml文 ...
- Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE
Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...
随机推荐
- delphi请求http接口中文乱码问题
请求http接口的时候参数值是中文乱码: http接口一般都是由java,php以及C#开发而成的,乱码的原因也是由于编码的问题,一般传递数据的都是utf8,然后传递的时候都会urlEcode 那么d ...
- 深度学习笔记(十四)车道线检测 SCNN
论文:Spatial As Deep: Spatial CNN for Traffic Scene Understanding 代码:https://github.com/XingangPan/SCN ...
- CodeForces–830A--二分,贪心
Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...
- OSI7层模型
为什么来写一个osi7层模型的随便呐? 因为自己对osi模型一点不熟悉 只知道里面的协议 要学渗透必先学习osi 这是一个osi7层的大体图片 接下来我们会对每一层进行详细的解答 这是五层模型 接下来 ...
- python递归获取目录下指定文件
获取一个目录下所有指定格式的文件是实际生产中常见需求. import os #递归获取一个目录下所有的指定格式的文件 def get_jsonfile(path,file_list): dir_lis ...
- Linux Ubuntu 用c++11编译
加上: -std=c++ 例如: g++ test.
- 8 Linux 文件类型
Linux 系统中的文件是没有扩展名的. 1.通过 ls -l 文件名,看第一个字符判断文件类型: - 普通文件(文本文件.二进制文件.压缩文件.电影.图片等) d 目录文件 b 设备文件(块设 ...
- tp5最强分页 自定义model,控制器引用。只显示一页
1.不多逼逼 model 代码 <?phpnamespace app\common\model; use think\Model; class Fpage{ private $page;//当前 ...
- .net 查壳工具
请问大神.NET查壳工具都有哪些? 已知的有DotNet Id 除了这个还有别的吗?脱MAXTOCODE发现是双壳.脱掉第一层还有一层,DotNet Id检测没壳了,但是反编译还是加密状态. 用 ...
- PHP中try catch的用法
异常(Exception)用于在指定的错误发生时改变脚本的正常流程. 什么是异常? PHP 5 提供了一种新的面向对象的错误处理方法. 异常处理用于在指定的错误(异常)情况发生时改变脚本的正常流程.这 ...