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中的路径有重复! 如:
随机推荐
- 为什么比特币和以太坊未必真得比EOS更去中心化?
在区块链行业里,有两派人一直在争论:一个是以比特币和以太坊为首的社群,另一个是以EOS为首的社群.这两群人一直在争论谁才是真正的未来,双方都认为自己这边更有未来.其中EOS抗争的重点就是100万TPS ...
- Python import与from import使用及区别介绍
Python程序可以调用一组基本的函数(即内建函数),比如print().input()和len()等函数.接下来通过本文给大家介绍Python import与from import使用及区别介绍,感 ...
- nmcli配置ipv6
nmcli配置ipv6 作者:Eric 微信:loveoracle11g [root@racooler ~]# nmcli connection show eno16777736 | grep ipv ...
- ct
b80e00u9dxwpqw7bt98rm5zmlxt08cxs A3WKXKBHWDUOEOP3EVJA2YRM6JSZPJWGTCQ5BSYAWI4GMSIXOAT2IQ
- VS2015创建类库项目后添加不了WPF资源字典,窗口,用户控件处理办法
打开项目工程文件在PropertyGroup标签最后加上下面3行: <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FA ...
- Vue 可输入可下拉组件的封装
由于业务需要,需要一个可输入也可下拉的组件,看了iview没有现成的组件用,就自己封装了个小组件~~ 组件input-select.vue代码: <template> <div cl ...
- php中上传图片,原生代码
一.实现图片上传方法一 html的写法: <form action="handle.php" name="form" method="post& ...
- 使用JavaScript制作页面特效2
1.Date对象的常用方法 setFullYear() setMonth() setDate() setHours() setMinutes() setSeconds() 定时函数 setTimeou ...
- 214. Spring Security:概述
前言 在之前介绍过了Shiro之后,有好多粉丝问SpringSecurity在Spring Boot中怎么集成.这个系列我们就和大家分享下有关这方面的知识. 本节大纲 一.什么是SpringSecur ...
- 【学习】如何安装GraphLab Create 【转载】
前人走过的路不用再走,慢慢加上一些工具的链接 GraphLab Create安装,链接地址: http://www.imooc.com/article/18094?block_id=tuijian_w ...