程序地带

Cannot determine embedded database driver class for database type NONE


org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

该错误意思是,数据库没有进行激活,或者是没有连接上,排查后发现是application.yml配置文件中出现了错误


server:
port: 8001
mybatis:
config-location: classpath:mybatis/mybatis.cfg.xml
type-aliases-package: com.springclud.entities
mapper-locations: classpath:mybatis/mapper/*.xml
spring:
application:
name: SpringCloud
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/clouddb01?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
username: root
password: 123456
dbcp2:
min-idle: 5
initial-size: 5
max-total: 5
max-wait-millis: 200
debug: true

其中datasource与application是同级别,所以这里写成了是application的下属级别,于是无法激活数据库的设置,故产生错误


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_33645786/article/details/112689365

随机推荐

IDEA的debug使用

IDEA的debug使用1、Rerun'xxx'(项目名):直接重新跑某个程序。2、Resume(恢复)Program:相当于eclipse中的f8。存在断...

微笑の天使 阅读(871)

vs2019远程调试docker部署的netcore webapi代码

调试注意几个问题1.最好在调试之前,把断点打好,再build镜像(不强求,有pdb文件就行)2.发布代码和vs2019最好都要配置为debug模式3.如果bu...

atzqtzq 阅读(242)

leetcode235. 二叉搜索树的最近公共祖先

二叉搜索树的最近公共祖先给定一个二叉搜索树,找到该树中两个指定节点的最近公共祖先。百度百科中最近公共祖先的定义为:“对于有根树T的两个结点p、q,最近公共祖先表示为一个结点...

路啦路 阅读(183)