文章正文
若依权限系统-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,若离线请留言!
热门阅读
-
沟通的艺术 看入人里,看出人外 插图修订第14版 (美)阿德勒,(美)普罗科特著;黄素菲,李恩译 北京:世界图书北京出版公司 PDF 9787510077463 2015.pdf
沟通的艺术 看入人里,看出人外 插图修订第14版 (美)阿德勒,(美)普罗科特著;黄素菲,李恩译 北京:世界图书北京出版公司 PDF 9787510077463 2015.pdf ...
-
惨死如狗 (西)佛朗西斯科·阿亚拉(Francisco Ayala)著;李德明译 上海:上海译文出版社 PDF 7532723259 1999.pdf
惨死如狗 (西)佛朗西斯科·阿亚拉(Francisco Ayala)著;李德明译 上海:上海译文出版社 PDF 7532723259 1999.pdf ...
-
“看不见的手”范式的悖论 崔之元著 北京:经济科学出版社 PDF 7505817221 1999.pdf
“看不见的手”范式的悖论 崔之元著 北京:经济科学出版社 PDF 7505817221 1999.pdf ...
-
寻常放荡 我的回忆在旅行 欧阳应霁著 北京:生活·读书·新知三联书店 PDF 7108022001 2004.pdf
寻常放荡 我的回忆在旅行 欧阳应霁著 北京:生活·读书·新知三联书店 PDF 7108022001 2004.pdf ...
-
追踪摩西的脚印 著皮埃尔·沙沃绘让-米歇尔·佩耶译黄馨慧 桂林市:广西师范大学出版社 PDF 7563344489 2004.pdf
追踪摩西的脚印 著皮埃尔·沙沃绘让-米歇尔·佩耶译黄馨慧 桂林市:广西师范大学出版社 PDF 7563344489 2004.pdf ...
-
交往行为理论 第1卷 行为合理性与社会合理化 (德)尤尔根·哈贝马斯(Jurgen Habermas)著;曹卫东译 上海:上海人民出版社 PDF 7208051488 出版时间:2004.pdf
交往行为理论 第1卷 行为合理性与社会合理化 (德)尤尔根·哈贝马斯(Jurgen Habermas)著;曹卫东译 上海:上海人民出版社 PDF 7208051488 出版时间:2004.pdf ...
-
哈贝马斯的交往行为理论与历史唯物主义 张雯雯著 北京:中国社会科学出版社 PDF 9787516175620 2016.pdf
哈贝马斯的交往行为理论与历史唯物主义 张雯雯著 北京:中国社会科学出版社 PDF 9787516175620 2016.pdf ...
-
交往行为理论 第1卷 (德)尤尔根·哈贝马斯著;曹卫东译 上海:上海人民出版社 PDF 9787208153547 2018.pdf
交往行为理论 第1卷 (德)尤尔根·哈贝马斯著;曹卫东译 上海:上海人民出版社 PDF 9787208153547 2018.pdf ...
-
中国城市规划史 汪德华著 南京:东南大学出版社 PDF 9787564151485 出版时间:2014.pdf
中国城市规划史 汪德华著 南京:东南大学出版社 PDF 9787564151485 出版时间:2014.pdf ...
-
八字运算法 子平术精析 徐伟刚著 北京:中国三峡出版社 PDF 7800996042 2006.pdf
八字运算法 子平术精析 徐伟刚著 北京:中国三峡出版社 PDF 7800996042 2006.pdf ...