码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2019-06-25 13:33:47      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:exp   sql   nested   table   end   failed   toc   error   name   

技术图片

解决方案:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

作用://取消数据库配置

技术图片

 但是

在用到数据库的时候记得将他改为 @SpringBootApplication , 否则会报错:如下
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘xxController‘: Unsatisfied dependency expressed through field ‘xxMapper‘;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxMapper‘ defined in file [D:\workspacesidea\pear\target\classes\com\wqq\mapper\xxMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required

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

标签:exp   sql   nested   table   end   failed   toc   error   name   

原文地址:https://www.cnblogs.com/Sarah-Strawberry/p/11082159.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!