Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource
***************************
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 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).
解决方法 1: 注解这样写:
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
解决方案 2:
1,。添加如下依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 移除嵌入式tomcat插件 不移除会启动报错 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
2.必须要加否则启动
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource的更多相关文章
- 创建spring boot项目启动报错遇到的问题
1.Spring boot,Mybatis 启动报错 Failed to auto-configure a DataSource *************************** APPLICA ...
- 【spring boot Mybatis】报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add
报错如下: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.i ...
- spring boot项目启动报错
在eclipse中运行没有任何问题,项目挪到idea之后就报错 Unable to start EmbeddedWebApplicationContext due to miss EmbeddedSe ...
- spring和mybatis整合报错:org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyExceptio ...
- spring 整合Mybatis 《报错集合,总结更新》
错误:java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldExcepti ...
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
- spring boot中连接数据库报错500(mybatis)
spring boot中连接数据库报错500(mybatis) pom.xml中的依赖 <!-- 集成mybatis--> <dependency> <groupId&g ...
- springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde
springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...
- libvirt启动报错Failed to start Virtualization daemon
libvirt启动报错Failed to start Virtualization daemon 1.启动libvirt的具体报错如下 [root@localhost IOS]# service li ...
随机推荐
- python 直接将list 整体转化-----------map()
假设有这样一个 results = ['1', '2', '3'] 转化为下面这个样子 results = [1, 2, 3] 我们可以使用map函数 在Python2中这样操作: results = ...
- wpf的datepicker处理(转)
如果有2个datepicker,控制时间起和止的话,可以把第二个datepicker加一个属性,DisplayDateStart = "{Binding SelectedDate,Eleme ...
- leetcode:Single Number【Python版】
1.用双重循环逐个遍历(超时) 2.用list B的append和remove函数(超时) 3.用dict B(AC) class Solution: # @param A, a list of in ...
- 树莓派做下载机+Web服务器(Aria2下载+yaaw做UI+nginx)
今天收到了小派,UK产的绿板子,还配了个透明盒子,装在里面闪亮亮的很好看,而且只有卡片大小,寻思着用它做什么好呢?想来想去,看到人家拿小派作家庭媒体中心,还有人拿它当下载机,于是就萌生了一个家庭媒体中 ...
- FastAdmin 将会员模块升级为基础模块的升级指导
说明 FastAdmin 于 2018-01-19 将会员模块升级为基础模块. 因为有数据库改动,所以需要对旧的数据库进行升级,不然没有办法使用和显示. 升级流程 git 合并代码 略 导入数据表 D ...
- js 各种循环遍历
js 各种循环遍历(表格比较) 遍历方法 能否遍历数组 能否遍历对象 备注 for 能 不能 for in 能(有诸多缺点) 能 为遍历对象而设计的,不适用于遍历数组 forEach 能 不能 bre ...
- Microsoft Dynamics CRM 4.0 Plugin 取值,赋值,查询
DynamicEntity postImageEntity = (DynamicEntity)context.PostEntityImages["PostImage"]; if ( ...
- zabbix监控进程的CPU和内存占用量,进程数量
由于需要对公司特定服务进行监控,于是,通过编写脚本获取各个进程占用系统资源的信息,从而使用zabbix采集到这些数据进行特定进程的基础监控. 我这主要需要监控的程序如下: nginx redis my ...
- bzoj1864 三色二叉树
Description Input 仅有一行,不超过500000个字符,表示一个二叉树序列. Output 输出文件也只有一行,包含两个数,依次表示最多和最少有多少个点能够被染成绿色. 记录每个节点染 ...
- R语言学习——向量,矩阵
在R中,基本的数据结构有:向量,矩阵,数组,数据框,列表,因子,函数等. 向量:一系列同类型的有序元素构成. 向量是一维结构. 向量是R最简单的数据结构,在R中没有标量. 标量被看成1个元素的向量. ...