报Error creating bean with name 'dataSource' defined in class path resource 报错解决办法
在学习spring boot 的数据库操作的时候,报了一串错误
对于初学spring boot的我来说,英语水平低,看不懂报错的信息,给我造成了很大的麻烦,花了我一天的时间,经过不懈的努力后终于让我找到了问题所在
spring boot会默认加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean,因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错
因此我们需要在Application类上面增加注解
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
参考链接:https://blog.csdn.net/q1035331653/article/details/80418026
报Error creating bean with name 'dataSource' defined in class path resource 报错解决办法的更多相关文章
- Error creating bean with name 'dataSource' defined in class path resource 报错解决办法
在学习spring boot 的数据库操作的时候,报了一串错误
- springboot启动报:Error creating bean with name 'dataSource' defined in class path resource
需要在启动类的@EnableAutoConfiguration或@SpringBootApplication中添加exclude = {DataSourceAutoConfiguration.clas ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [app2.xml]: Instantiation of bean failed; nested exception is org.spr
在学习spring整合hubernate时遇到的问题.c3p0遇到了一个问题,老连不上,显示java.lang.NoClassDefFoundError:com.mchange.v2.ser.Indi ...
- Spring Boot - Error creating bean with name 'dataSource' defined in class path resource
看起来像最初的问题是与自动配置. 如果你不需要数据源,只需从自动配置过程中删除它: @EnableAutoConfiguration(exclude={DataSourceAutoConfigurat ...
- SpringBoot Error creating bean with name 'dataSource' defined in class path resource。。。
启动spring boot项目出错 解决方法在Application类上增加:@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [spring/applicationContext-service.xml]: Cannot resolve refer
<!-- aop --> <aop:config> <aop:pointcut expression="execution(* com.zsn.Service. ...
- Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........
完整报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'befo ...
- 使用SpringMVC报错 Error creating bean with name 'conversionService' defined in class path resource [springmvc.xml]
使用SpringMVC报错 Error creating bean with name 'conversionService' defined in class path resource [spri ...
- 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]
报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...
随机推荐
- [物理学与PDEs]第5章习题7 各向同性材料时稳定性条件的等价条件
在线性弹性时, 证明各向同性材料, 稳定性条件 (5. 27) 等价于 Lam\'e 常数满足 $$\bex \mu>0,\quad \lm+\cfrac{2}{3}\mu>0. \ee ...
- JS 正则中的命名捕获分组
假设你在一段陌生的代码中看到这样一个函数: function toLocalDate(date) { return date.replace(/(\d{2})-(\d{2})-(\d{4})/, &q ...
- Flink学习(三)状态机制于容错机制,State与CheckPoint
摘自Apache官网 一.State的基本概念 什么叫State?搜了一把叫做状态机制.可以用作以下用途.为了保证 at least once, exactly once,Flink引入了State和 ...
- clam简单使用
clam简单使用: 0,首先,要全局安装Nodejs,不再赘述.clam依赖node使用 1,打开 cmd 2,全局安装clam:npm -g install clam 3,切换到目的盘下,新建一个空 ...
- HTTP协议12-HTTPS
1)HTTP的缺点 通信使用明文(不加密),内容可能会被窃听 不验证通信方的身份,因此有可能遭遇伪装 无法证明报文的完整性,所有有可能已被篡改 1.1 通信使用明文可能会被窃听 由于HTTP本身不具备 ...
- VMware的NAT网络模式
参考链接:https://www.cnblogs.com/linjiaxin/p/6476480.html 图例:
- 帆软报表(finereport)参数组合/下拉参数联动
首先实现下拉参数联动 1.参数的定义→添加控件绑定数据→参数过滤和参数面板样式 下拉复选框控件注意事项:select * from tablewhere 1=1${if(len(控件名称)=0,&qu ...
- 让CPU占用率曲线听你指挥
使用GetTickCount()和Sleep(): Code#include <stdio.h> #include <unistd.h> #include <time.h ...
- .Net Core ----通过XUnit进行接口单元测试(带请求头及参数)并用output输出结果
最近在做core的接口单元测试,所以在这拿出来分享一下,添加XUnit的nuget包 话不多说,直接上代码了: 输出结果(需要的命名空间using Xunit.Abstractions;): ITes ...
- linux 乌班图 lnmp环境搭建
1.#安装Apache2,目前163的源是2.2.22版本02.sudo apt-get install apache203. 04.#安装MySQL,目前163的源是5.5.24版本05.apt-g ...