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. windows10下 MySQL5.7.18版本安装过程及遇到的问题

    windows10下 MySQL5.7.18版本安装过程及遇到的问题           mysql-5.7.18-winx64 安装           1.解压 此次将MySQL装在H盘,依个人喜 ...

  2. Avalon MM 总线

    对于Avalon Master来讲,Address信号代表一个字节(8-bit)的地址.Address的值必须与字节的宽度对齐,如果要对某个word的byte写,需要首先使用byteenable信号: ...

  3. HP-Socket v5.0.1:支持 IPv6 及多 SSL 证书

    HP-Socket 是一套通用的高性能 TCP/UDP/HTTP 通信框架,包含服务端组件.客户端组件和 Agent 组件,广泛适用于各种不同应用场景的 TCP/UDP/HTTP 通信系统,提供 C/ ...

  4. C#将unix时间戳转换成.net的DateTime类型的代码

    下面的内容是关于C#将unix时间戳转换成.net的DateTime类型的内容. DateTime epoch = new DateTime(1970,1,1,0,0,0,0, DateTimeKin ...

  5. 解决导出CSV后在EXCEL打开纯数字前面0丢失问题

    select ip ,concat('="',accountname,'"')select ip ,concat('="',accountname,'"')

  6. 2018-2019-2 20165205 Exp2 后门原理与实践

    20165205 Exp2 后门原理与实践 实验内容 一.基础问题回答 列举你能想到的一个后门进入到你系统中的可能方式 下载盗版软件.操作系统 当然正版软件里可能也有编写者安装的后门 不在官方更新软件 ...

  7. Flutter环境搭建

    本文介绍mac上搭建Flutter环境 1.Flutter官方提供中国地区镜像地址:https://github.com/flutter/flutter/wiki/Using-Flutter-in-C ...

  8. Python中的split()函数的用法

    函数:split() Python中有split()和os.path.split()两个函数,具体作用如下:split():拆分字符串.通过指定分隔符对字符串进行切片,并返回分割后的字符串列表(lis ...

  9. DO,DTO和VO的使用

    DO,DTO和VO的使用 DO:对应数据库表结构 VO:一般用于前端展示使用 DTO:用于数据传递.(接口入参和接口返回值都可以) 以ssm框架为例: controller层: public List ...

  10. Python module ---- argparse

    argparse是python用于解析命令行参数和选项的标准模块,用于代替已经过时的optparse模块.argparse模块的作用是用于解析命令行参数,程序只需定义好它要求的参数,然后argpars ...