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)}
经过几次排查发现都没错。
于是检查启动类:
发现注解写错了。
还没有评论,来说两句吧...