文章正文
若依权限系统-system 模块集成动态数据源 + Druid 启动报错
【文章】2021-04-08
简介若依权限系统-system 模块集成动态数据源 + Druid 启动报错
错误提示
17:26:18.438 [main] INFO c.a.d.s.b.a.DruidDataSourceAutoConfigure - [dataSource,56] - Init DruidDataSource17:26:18.531 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - [refresh,559] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysConfigController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysConfigServiceImpl': Unsatisfied dependency expressed through field 'configMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysConfigMapper' defined in file [D:datagitgee_workRuoYi-Cloud uoyi-modules uoyi-system argetclassescom uoyisystemmapperSysConfigMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class17:26:18.533 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat]17:26:18.567 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] - *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver classAction: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).17:26:18.569 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,108] - [HttpClientBeanHolder] Start destroying common HttpClient17:26:18.570 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,114] - [HttpClientBeanHolder] Destruction of the endProcess finished with exit code 1
解决方案一
建议在 system 项目中的 bootstrap.yml 文件添加如下配置项
spring: autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
解决方案二
这段配置在application-dev.yml配置文件中有配置的~ 所以应该是你的application-dev.yml未加载导致的~
原配置如下:
spring: main: allow-bean-definition-overriding: true autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
新修改为:
spring: autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure main: allow-bean-definition-overriding: true
打赏支持
感谢您的支持,加油!
打开微信扫码打赏,你说多少就多少
找书费时,联系客服快速查找!
在线客服8:30-22:30,若离线请留言!
获取教程,请联系在线客服!
在线客服8:30-22:30,若离线请留言!
热门阅读
-
单晓天小楷 单晓天书 上海:上海书画出版社 PDF 81721904 1987.pdf
单晓天小楷 单晓天书 上海:上海书画出版社 PDF 81721904 1987.pdf ...
-
当代中国社会分层与流动 李强著 北京:中国经济出版社 PDF 7501724148 出版时间:1993.pdf
当代中国社会分层与流动 李强著 北京:中国经济出版社 PDF 7501724148 出版时间:1993.pdf ...
-
儒家哲学史讲演录 第2卷:从《春秋》到荀子 张祥龙 著 商务印书馆 9787100176866 PDF_出版时间:2019年10月.pdf
儒家哲学史讲演录 第2卷:从《春秋》到荀子 张祥龙 著 商务印书馆 9787100176866 PDF_出版时间:2019年10月.pdf ...
-
香港发展地图集 薛凤旋编著 三联书店(香港)有限公司 PDF N9620414810 出版时间:2001.pdf
香港发展地图集 薛凤旋编著 三联书店(香港)有限公司 PDF N9620414810 出版时间:2001.pdf ...
-
实验经济学 如何构建完美的金融市场 the quest for the perfect market (美)罗斯·米勒(Ross Miller)著;于泽,李彬译 北京:中国人民大学出版社 PDF 7300065724 出版时间:2006.pdf
实验经济学 如何构建完美的金融市场 the quest for the perfect market (美)罗斯·米勒(Ross Miller)著;于泽,李彬译 北京:中国人民大学出版社 PDF 7300065724 出版时间:2006.pdf ...
-
星载高分辨率宽幅SAR成像技术 邓云凯 9787030645166 科学出版社 PDF_出版时间:2020年04月.pdf
星载高分辨率宽幅SAR成像技术 邓云凯 9787030645166 科学出版社 PDF_出版时间:2020年04月.pdf ...
-
世纪的诞生 汪晖 生活.读书.新知三联书店 9787108066800 PDF_出版时间:2020年06月.pdf
世纪的诞生 汪晖 生活.读书.新知三联书店 9787108066800 PDF_出版时间:2020年06月.pdf ...
-
行政许可中特许权的物权属性与制度构建研究_王克稳 , 2015.07_591_PDF_13864837.pdf
行政许可中特许权的物权属性与制度构建研究_王克稳 , 2015.07_591_PDF_13864837.pdf ...
-
唐汉解字:汉字密码与动物世界 唐汉编 海口:海南出版社 PDF 7805907846 出版时间:2002.pdf
唐汉解字:汉字密码与动物世界 唐汉编 海口:海南出版社 PDF 7805907846 出版时间:2002.pdf ...
-
数据库管理与数据分析 SQL Server 2012+Tableau 郭进,吕峻闽,徐鸿雁著 北京:电子工业出版社 PDF 9787121321894 出版时间:2017.pdf
数据库管理与数据分析 SQL Server 2012+Tableau 郭进,吕峻闽,徐鸿雁著 北京:电子工业出版社 PDF 9787121321894 出版时间:2017.pdf ...