Bean method 'jdbcTemplate' not loaded because @ConditionalOnSingleCandidate
springboot学习jdbcTemplate操作数据库的过程中,出现这个问题
后来发现是由于程序中有配置下面这个注解
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
一开始学习springboot的时候没有配置数据源,但是springboot默认是需要实现数据源配置的,因此需要配置这个注解,并且配置了两个地方
在遇到问题后,注释了启动程序中的这个注解,但是忘记了在另一个Controller中也配置了这个注解,因此出现该问题
解决办法:
在学习springboot数据库操作过程中,删掉或者注释掉工程中所有的DataSourceAutoConfiguration注解
Bean method 'jdbcTemplate' not loaded because @ConditionalOnSingleCandidate的更多相关文章
- 问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded.
背景 今天将一个SpringBoot项目的配置参数从原有的.yml文件迁移到Apollo后,启动报错“Bean method 'rocketMQTemplate' in 'RocketMQAutoCo ...
- Ambiguous mapping found. Cannot map 'xxxxController' bean method
1.背景 今天要做一个demo,从github上clone一个springmvc mybatis的工程(https://github.com/komamitsu/Spring-MVC-sample-u ...
- there is already 'RtController' bean method 项目报错
今天开发项目时候发现项目报错启动的时候,也没有具体指的是哪一行报错,其实很简单的知道,首先看下报错信息: there is already 'RtController' bean method pub ...
- Cannot map 'XXXController.Create' bean method
[转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...
- SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法
[转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...
- Ambiguous mapping found. Cannot map 'competeController' bean method
报错: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMapp ...
- 根据日志分析异常:There is already 'XXX' bean method
问题代码: @Slf4j @Api(value = "paymentOrderController", description = "PaymentOrderContro ...
- 【实战问题】【2】Ambiguous mapping found. Cannot map 'xxController.Create' bean method
正文: 启动项目时出现该报错. 原因为:在controller中url映射出现重复,@RequestMapping(value = "user/create"). 解决方案为:全局 ...
- 关于报错:There is already 'xxxController' bean method的解决方法
报这个错的原因是因为你controller里的@RequestMapping中的路径有重复! 如:
随机推荐
- pyexecjs模块
1,找到断点事件 2,浏览call stack 下面的代码,找到需要的值 3,F11进入方法内部 对于网站自己定义的方法,可以用py复制下来进行执行js N = function (a, b, c) ...
- 机器学习笔记之二-win10+cuda9.1+CUDNN7+Anaconda3+VS2017+tensorflow1.5+opencv3.4
[Tensorflow]环境搭建vs2017+win10+py3.6+cuda9.1+cudnn7+tf1.5 一.安装cuda 9.1+VS2017 一路下一步即可,环境变量cuda会自动配好 ...
- Three failed attempts of handling non-sequential data
The Progress of Products Classification Cause now we are considering to classify the product by two ...
- WPF常用TriggerAction用法 (一)
Microsoft.Expression.Interactivity 常用TriggerAction-> CallMethodAction ChangePropertyAction Contro ...
- SOD框架的Model、连接数据库及增删改查
using PWMIS.DataMap.Entity; using System; using System.Collections.Generic; using System.Linq; using ...
- c++数据类型漫谈
在计算机眼里所有数据都是0101,二进制才是物理世界的主宰,c++的数据类型相对其他高级语言是相对较细的,因为是继承C而来,但是c++为什么要设计这么多数据类型呢?因为人类难以理解二进制,这就是数据类 ...
- Verilog笔记——Verilog数字系统设计(第二版)夏宇闻
本片记录Verilog学习笔记,主要是和以往用的C语言的不同之处,以例子.代码的形式记录.学习以<Verilog数字系统设计>(第二版)为参考资料,援助作者夏宇闻. 1. C语言和Veri ...
- ArcGIS API for JS 测量线长(各折线段)
这里测量长度主要分为两个方面,一个是在绘制长折线段时,不仅需要显示总线段的长度,还要在各线段的中间显示各折线段的长度:另一个则是在绘制多边形时,不仅需要显示多边形的面积,还需要在各边的中间显示线段长. ...
- Stack类常用api
1.构造函数 Stack只有一个默认构造函数 Stack() Stack<Integer> stack = new Stack<Integer>(); 2.常用api (1)入 ...
- 42_redux_counter应用_redux异步版本
前言: redux默认不支持异步编程,需要下载redux插件(异步中间件) 如何下载: npm install --save redux-thunk 项目结构: 代码: import React, { ...