Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasourc
Posted sarah-strawberry
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasourc相关的知识,希望对你有一定的参考价值。
解决方案:
@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 datasourc的主要内容,如果未能解决你的问题,请参考以下文章
struts报错严重: Dispatcher initialization failed Unable to load configuration.
Failed to upgrade Oracle Cluster Registry configuration(root.sh)
安装Intel HAXM:"failed to configure driver unknown error. failed to open driver"
Failed to configure a DataSource 'url' attribute问题解决
springboot启动报错:Failed to configure a DataSource
Springboot Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded