博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringBoot 启动失败 Failed to determine a suitable driver class 问题解决方案
阅读量:4708 次
发布时间:2019-06-10

本文共 1601 字,大约阅读时间需要 5 分钟。

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标签中加入如下内容:
            
                
src/main/java
                
                    
**/*.yml
                    
**/*.properties
                    
**/*.xml
                
                
false
            
            
                
src/main/resources
                
                    
**/*.yml
                    
**/*.properties
                    
**/*.xml
                
                
false
            
        

 

转载于:https://www.cnblogs.com/ityemu/p/11097788.html

你可能感兴趣的文章
NFS应用场景及环境搭建
查看>>
让xamarin的Entry绑定时,支持Nullable类型
查看>>
kivy学习三:打包成window可执行文件
查看>>
兄弟连PHP培训教你提升效率的20个要点
查看>>
【快报】基于K2 BPM的新一代协同办公门户实践交流会
查看>>
关于MySQL的行转列的简单应用
查看>>
Queue 队列的用法
查看>>
CDM常用命令
查看>>
游戏开发中常用的设计模式
查看>>
Linux 中/etc/profile、~/.bash_profile 环境变量配置及执行过程
查看>>
JAVA:图形之利用FontMetrics类居中
查看>>
使用rsync同步目录
查看>>
[读码时间] for循环遍历设置所有DIV块元素背景色为红色
查看>>
你会用AngularJS,但你会写AngularJS文档么?
查看>>
ORACLE清除某一字段重复的数据(选取重复数据中另一个字段时期最大值)
查看>>
网页调用迅雷下载文件
查看>>
Python 调用 Shell命令
查看>>
POJ 1159 Palindrome(最长公共子序列)
查看>>
ORM多表操作之多对多查询
查看>>
Oracle管理监控之sql developer配置与简单使用
查看>>