Springboot 添加数据源报错
报错信息如下:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.sql.DataSource' available: expected at least bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:)
... more
需要在配置类中添加
@ConfigurationProperties(prefix="spring.datasource")
@Bean
public DataSource druid(){
return new DruidDataSource();
}
Springboot 添加数据源报错的更多相关文章
- 新版本grafana添加数据源报错!
前提: grafana配置的数据源url没有错误. 现象: 1)升级完grafana之后发现原来配置的open-facon数据源无效了,一直提示HTTP ERROR NOT FOUND. 2)安装新版 ...
- springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde
springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...
- Springboot数据库连接池报错的解决办法
Springboot数据库连接池报错的解决办法 这个异常通常在Linux服务器上会发生,原因是Linux系统会主动断开一个长时间没有通信的连接 那么我们的问题就是:数据库连接池长时间处于间歇状态,导致 ...
- Loadrunner参数化连接oracle、mysql数据源报错及解决办法
Loadrunner参数化连接oracle.mysql数据源报错及解决办法 (本人系统是Win7 64, 两位小伙伴因为是默认安装lr,安装在 最终参数化的时候,出现连接字符串无法自动加载出来: 最 ...
- AS添加依赖报错Unable to merge dex
AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...
- ORACLE数据导入导出后新数据库中某些表添加操作报错[ORA-12899]
由于项目需要,我在搭建了新的开发环境后,需要将之前环境中的ORACLE数据库导出,再导入到新的开发环境下.当导出导入完成后,使用数据库进行添加操作时 发现针对很多表的添加操作报错,具体报错原因描述为: ...
- Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans
Springboot 启动文件报错,原因是@ComponentScan写成了@ComponentScans
- ArcGIS Runtime SDK for WPF之SimpleRenderer无法添加、报错“图形符号无法序列化为 JSON”
ArcGIS Runtime SDK for WPF之SimpleRenderer无法添加.报错“图形符号无法序列化为 JSON” 在上一篇博文中如果在 esri:Map 里面是否设置了的UseAcc ...
- springboot测试启动报错java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
springboot测试启动报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne ...
随机推荐
- jQuery EasyUI,LinkButton(按钮)组件
转自:https://www.cnblogs.com/adc8868/p/6639570.html jQuery EasyUI,LinkButton(按钮)组件 学习要点: 1.加载方式 2.属性列表 ...
- 关于js-cookie使用出现兼容性问题以及js-cookie的如何使用
最近使用vue开发的项目,开发过程引入了js-cookie插件,在PC端以及移动端网页调试都没出现问题,但是打包成APP在安卓手机调试发现使用js-cookie保存的数据失效了,然后只能使用local ...
- js 获取图片宽高 和 图片大小
获取要查看大小的img var img_url = 'http://img5.imgtn.bdimg.com/it/u=4267222417,1017407570&fm=200&gp= ...
- 基于Hexo且在GitHub上搭建博客
title: 基于Hexo且在GitHub上搭建博客 Welcome to Fofade's Blog! 搭建初衷 大大小小,大学两年,玩了很多,也学了很多. 回首望之,曾经不知道的,现在是知道了,但 ...
- npm install 安装软件,出现 operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache'
问题如下图: 解决办法: 在开始菜单栏里打开cmd的时,右击选择“以管理员身份运行”.然后再在打开的cmd里运动install就没问题了. 这个问题应该是当时安装依赖时,我们是以管理员身份运行的:所以 ...
- 最大加权矩形 luogu1719
题目链接:https://www.luogu.org/problemnew/show/P1719 这道题挺好做的 又是一道练前缀和的题 #include <bits/stdc++.h> # ...
- GIT学习之路最终日 标签管理+总结
本文参考廖雪峰老师的博客进行总结,完整学习请转廖雪峰博客 6.1 创建标签 命令git tag (name)用于新建一个标签,默认为HEAD,也可以指定一个commit id: git tag -a ...
- 【hdu多校联考第二场】Odd Shops
Description 这道题的题意是这道难读,大概就是给你n个商店,每个商店的重量为i的商品用ai表示,对于任意商店的a数列都是相同的,重量的范围为[1,10] 求购买方案总数为奇数的重量一共有多少 ...
- js操作元素透明度以及浏览器兼容性
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- Tomcat无法clean,无法remove部署的项目
错误: 对部署在Tomcat下的项目进行clean操作,总是提示Could not load the Tomcat server configuration,错误信息如图: 解决: 原来是将Serve ...