首页 > 数据库技术 > 详细

spring boot 启动报错:Cannot determine embedded database driver class for database type NONE

时间:2018-02-04 12:15:39      阅读:608      评论:0      收藏:0      [点我收藏+]

错误原因:spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错。

解决办法:第一种:在Application类上增加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}),阻止spring boot自动注入dataSource bean

     第二种:增加数据库配置相关信息

 技术分享图片

 

springboot之freemarker:

创建springboot项目,在pom中添加了freemarker的jar包,

技术分享图片

 

在controller层写好相关代码并且把信息传到指定的.ftl文件中,

技术分享图片

 

在.ftl中把信息取出来

技术分享图片

启动,运行正常!

技术分享图片

 

spring boot 启动报错:Cannot determine embedded database driver class for database type NONE

原文:https://www.cnblogs.com/salycr/p/8412669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!