SpringBoot项目刚刚创建就报异常,Failed to configure a DataSource: 'url' attribute is not specified and no embedded 的解决办法
错误信息:
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
直接翻译成中文,一看便知了 “ 配置数据源失败:没有指定’url’属性,也不能配置嵌入式数据源。 ”
解决的办法:
先导入依赖试试:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
如果不行,那就执行下一步:
在主启动类的注解加上这个 exclude=DataSourceAutoConfiguration.class
如果不行,就配上 数据库的信息
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username = root
spring.datasource.password = 123456
SpringBoot项目刚刚创建就报异常,Failed to configure a DataSource: 'url' attribute is not specified and no embedded 的解决办法的更多相关文章
- springboot启动报错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
新建了一个springboot项目报一下错误: Failed to configure a DataSource: 'url' attribute is not specified and no em ...
- Spring Boot错误——SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
背景 使用Spring Cloud搭建微服务,服务的注册与发现(Eureka)项目启动时报错,错误如下 *************************** APPLICATION FAILED T ...
- Spring Boot 2.1.7 启动项目失败,报错: "Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured."
一开始按照网上的很多解决办法是: 启动类头部声明@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}),但是这样会排除 ...
- 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 创建 ...
- 新建springboot项目启动出错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
错误信息入下: 2018-06-23 01:48:05.275 INFO 7104 --- [ main] o.apache.catalina.core.StandardService : Stopp ...
- SpringBoot 2.0 报错: Failed to configure a DataSource: 'url' attribute is not specified and no embe
问题描述 *************************** APPLICATION FAILED TO START *************************** Description ...
- SpringBoot使用mybatis,发生:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured
最近,配置项目,使用SpringBoot2.2.1,配置mybatis访问db,配好后,使用自定义的数据源.启动发生: APPLICATION FAILED TO START ************ ...
- 记一次Spring boot集成mybatis错误修复过程 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
最近自己写了一份代码签入到github,然后拉下来运行报下面的错误 Error starting ApplicationContext. To display the conditions repor ...
- 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 ...
随机推荐
- Java有没有goto?
goto是Java中的保留字,暂时还不是Java的关键字.
- CHAR 和 VARCHAR 的区别?
1.CHAR 和 VARCHAR 类型在存储和检索方面有所不同 2.CHAR 列长度固定为创建表时声明的长度,长度值范围是 1 到 255 当 CHAR 值被存储时,它们被用空格填充到特定长度,检索 ...
- java-可变参数hei
/* 使用前提: 当前方法的参数的数据类型已经确定,但是参数的个数不确定,就可以使用可变参数 使用格式: 定义方法是使用 修饰符 返回类型 方法名(数据类型... 变量名){} 可变参数的原理: 可变 ...
- Linux 环境下如何查找哪个线程使用 CPU 最长?
1.获取项目的 pid,jps 或者 ps -ef | grep java,这个前面有讲过 2.top -H -p pid,顺序不能改变
- 学习Nginx(三)
nginx的性能测试及常用优化手段 一.nginx的性能测试及对比 1.环境准备 [root@test8_hadoop_kaf ~]# yum install -y httpd-tools [ro ...
- Tomcat配置文件之“server.xml”解析
<?xml version="1.0" encoding="UTF-8"?> <!--代表整个Servlet容器组件,是最顶层元素.它里面可以 ...
- fsdfd
static int kWeiOfVal(int val, int k) { int n = 1; int temVal = val; int result; while (1) { temVal = ...
- MiL → SiL → PiL → HiL 是什么?
基于模型的快速原型开发通常分为四个过程:MiL → SiL → PiL → HiL 1. MiL(Model in Loop)模型在环 在PC上基于模型的测试,它的输出是经过验证的控制算法模型.验证 ...
- 如何基于 ZEGO SDK 实现 Android 一对一音视频聊天应用
疫情期间,很多线下活动转为线上举行,实时音视频的需求剧增,在视频会议,在线教育,电商购物等众多场景成了"生活新常态". 本文将教你如何通过即构ZEGO sdk在Android端搭建 ...
- SQL之总结(一)
导游通项目之总结SQL 1.选择前面的某几个 oracle: select * from tb_article where rownum<5 order by article_id ...