SpringBoot报错“To display the auto-configuration report re-run your application with ‘debug‘ enabled.“
Posted 二木成林
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot报错“To display the auto-configuration report re-run your application with ‘debug‘ enabled.“相关的知识,希望对你有一定的参考价值。
异常
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2021-06-13 13:18:55.548 ERROR 79340 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field service in com.demo.springcloud.controller.Controller required a bean of type 'com.demo.springcloud.service.DeptService' that could not be found.
Action:
Consider defining a bean of type 'com.demo.springcloud.service.DeptService' in your configuration.
原因
在控制器类中注入了DeptService类
但是DeptService并没有注册成为Bean,交由Spring容器管理。
解决
在DeptService接口的实现类上添加@Service注解,注册成为Bean。
以上是关于SpringBoot报错“To display the auto-configuration report re-run your application with ‘debug‘ enabled.“的主要内容,如果未能解决你的问题,请参考以下文章