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. [UE4]镜像

    一.这是一个右手模型,通过镜像可以得到一个左右模型. 二.通过上图分析,镜面是X轴和Z轴形成的一个面,Y轴与XZ面垂直,因此就是镜像Y轴,将模型的Transform.Scale.Y设置为-1,即可得到 ...

  2. [UE4]修改瞬移操作方式,默认正前方

    瞬移的时候,如果箭头指向正前方的角度跟中心线相差不大,则可以强制箭头指向中心线. 因为向量也可以表示方向,因此只要只要判断向量长度就是了,判断VectorLength值即可:

  3. mfc添加自定义事件

    1.在对话框的头文件里面添加声明函数: afx_msg void OnStnClickedPicStop(); 2.在对话框的源文件添加 BEGIN_MESSAGE_MAP(CPcEn3dTestDl ...

  4. SN Writer 写号工具使用

               SN Writer 写号工具的使用 蓝牙写号: 打开SN Writer 写号工具 1.点击System Config按钮 2.进入界面,选择需要写号的类型,及选择相应的写号文件, ...

  5. Jq写个联级菜单

    这个效果很好看,Jq很容易实现: $(document).ready(function(){ $('.menu li').hover(function(){ $(this).children('ul' ...

  6. DOM随时记

    1.node-type 返回元素的节点类型:可以在标签上进行设置 node-type="item"   ---来自新浪微博的首页写法

  7. chown nagios:nagios -R /var/lib/php/

    chown nagios:nagios -R /var/lib/php/

  8. python远程执行dos命令

    https://blog.csdn.net/huaihuaidexiao/article/details/5543240 https://blog.csdn.net/bcbobo21cn/articl ...

  9. opencv常用api

    opencv常用api 一.图像及视频读写 img=cv2.imread('jiang.jpg',1)    cv2.imwrite('jiang.jpg',img)   cv2.imshow('ji ...

  10. 模块(modue)和包(package)的概念-import导入模块

    模块 在计算机程序的开发过程中,随着程序代码越写越多,在一个文件里代码就会越来越长,越来越不容易维护. 为了编写可维护的代码,我们把很多函数分组,分别放到不同的文件里,这样,每个文件包含的代码就相对较 ...