springboot学习jdbcTemplate操作数据库的过程中,出现这个问题

  后来发现是由于程序中有配置下面这个注解

 @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})

  一开始学习springboot的时候没有配置数据源,但是springboot默认是需要实现数据源配置的,因此需要配置这个注解,并且配置了两个地方

  在遇到问题后,注释了启动程序中的这个注解,但是忘记了在另一个Controller中也配置了这个注解,因此出现该问题

  解决办法

    在学习springboot数据库操作过程中,删掉或者注释掉工程中所有的DataSourceAutoConfiguration注解

 

    

Bean method 'jdbcTemplate' not loaded because @ConditionalOnSingleCandidate的更多相关文章

  1. 问题排查之'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 ...

  2. Ambiguous mapping found. Cannot map 'xxxxController' bean method

    1.背景 今天要做一个demo,从github上clone一个springmvc mybatis的工程(https://github.com/komamitsu/Spring-MVC-sample-u ...

  3. there is already 'RtController' bean method 项目报错

    今天开发项目时候发现项目报错启动的时候,也没有具体指的是哪一行报错,其实很简单的知道,首先看下报错信息: there is already 'RtController' bean method pub ...

  4. Cannot map 'XXXController.Create' bean method

    [转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...

  5. SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法

    [转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...

  6. Ambiguous mapping found. Cannot map 'competeController' bean method

    报错: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMapp ...

  7. 根据日志分析异常:There is already 'XXX' bean method

    问题代码: @Slf4j @Api(value = "paymentOrderController", description = "PaymentOrderContro ...

  8. 【实战问题】【2】Ambiguous mapping found. Cannot map 'xxController.Create' bean method

    正文: 启动项目时出现该报错. 原因为:在controller中url映射出现重复,@RequestMapping(value = "user/create"). 解决方案为:全局 ...

  9. 关于报错:There is already 'xxxController' bean method的解决方法

    报这个错的原因是因为你controller里的@RequestMapping中的路径有重复! 如:

随机推荐

  1. python之路——23

    复习 1.类定义 函数--方法--动态属性 必须传self 变量--类属性--静态属性 __init__方法--初始化方法2.实例化 1.使用:对象 = 类() 2.实例和对象没有区别 3.对象调用方 ...

  2. 电脑忘记WiFi密码了,但又想知道,该怎么办?

    如何查看电脑已经连过的WiFi的密码? 你有没有遇到这样的情况,电脑之前连过的WiFi,正好手机也想连此WiFi,但是忘记密码了,没有WiFi的手机怎么能叫手机呢?.下面我们来看看如何查看已连接过的W ...

  3. docker 搭建 hustoj

    docker 搭建 hustoj hustoj 是个GPL开源的OJ,其提供了docker形式的安装方式. 为执行方便,选择使用aliyun提供的docker镜像来加速安装. 拉取镜像 docker ...

  4. sass 和less 分别在循环 和超出省略方面的区别!

    这两天在迁项目,新项目支持less预处理器,之前是采用的sass,就出现一些冲突,好在有对应的转换方式,重点说下 我遇到的2个问题 1:超出省略 sass: 声明: 在需要的地方: less: 在使用 ...

  5. 音乐出身的妹纸,零基础学习JAVA靠谱么

    问:表示音乐出身的妹纸一枚  某一天突然觉得身边认识的是一群程序员   突然想 要不要也去试试... 众好友都觉得我该去做个老师,可是我怕我会误人子弟,祸害祖国下一代..... 要不要 要不要 学Ja ...

  6. vue学习好文连接

    1.什么是虚拟dom(VNode)? https://github.com/answershuto/learnVue/blob/master/docs/VNode%E8%8A%82%E7%82%B9. ...

  7. php 操作mysql

    //由于前期数据库字段设计问题,没太注意,字段内容,后台python采集数据直接插入,没做处理,数据又不想丢掉,只能对网站数据库字段内容进行处理,100万条数据,调试了半天,很多思路都试过,各种坑,弄 ...

  8. Python的迭代器和生成器

    列表生成式 列表生成式可以快速创建list. >>> [x * x for x in range(1, 11) if x % 2 == 0] [4, 16, 36, 64, 100] ...

  9. 214. Spring Security:概述

    前言 在之前介绍过了Shiro之后,有好多粉丝问SpringSecurity在Spring Boot中怎么集成.这个系列我们就和大家分享下有关这方面的知识. 本节大纲 一.什么是SpringSecur ...

  10. 列举spark所有算子

    一.RDD概述      1.什么是RDD           RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是Spark中最基本的数据抽象,它代表一个不可 ...