spring boot 配置文件后缀的一个坑

编程入门 行业动态 更新时间:2024-10-18 22:30:35

Caused by: 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).

spring boot配置文件支持 properties和yml,从yml配置文件拷贝了一个数据源到properties的项目中死活不行一直报这样的错

说是跟驱动有关系,但是驱动都有,druid的连接池都有,几番尝试无果,从新创建一个demo试试
用https://start.spring.io创建的

创建的时候,mysql,mybatis,JDBC都勾选上了

直接 maven install ,居然报一样的错,因为新建的项目,就把数据库连接配上

spring.datasource.url = jdbc:mysql://127.0.0.1:3306/ctb
spring.datasource.driver-class-name = com.mysql.jdbc.Driver

然后再启动就不报错了,恍然大悟,肯定是程序无法识别 以冒号缩进,格式的配置,就把配置文件改成了yml,然后,就没有然后了,就成功了

更多推荐

spring boot 配置文件后缀的一个坑

本文发布于:2023-06-13 07:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357994.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后缀   配置文件   spring   boot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!