本文主要是介绍Consider defining a bean of type xxx.xxx.xxxxin your configura,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
最近做项目时,启动总是报错:
Description:
Field cmsPageClient in com.xuecheng.manage_course.service.CourseService required a bean of type ‘com.xuecheng.manage_course.client.CmsPageClient’ that could not be found.
Action:
Consider defining a bean of type ‘com.xuecheng.manage_course.client.CmsPageClient’ in your configuration.
2020-02-16 17:30:18.518 [main] DEBUG o.s.b.d.LoggingFailureAnalysisReporter - Application failed to start due to an exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.xuecheng.manage_course.client.CmsPageClient’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
经过几次排查发现都没错。
于是检查启动类:
发现注解写错了。
这篇关于Consider defining a bean of type xxx.xxx.xxxxin your configura的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!