最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

[SpringBoot报错]Consider defining a bean of type ‘xxx‘ in your configuration, NoSuchBeanDefinitionExce

业界 admin 6浏览 0评论

报错详情:

  • Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

  • 2022-08-03 09:41:13.156|ERROR|||||||||||main|LoggingFailureAnalysisReporter|

  • ***************************

  • APPLICATION FAILED TO START

  • ***************************

  • Description:

  • Field UserRoleRefv01Service in com.xxx.xxxx.xxxxx.xxxxxx.controller.v01.controller.xxxxxController required a bean of type 'xxx.xxxx.xxxx.xxxxxx.xxxxxx.service.portal.v01.service.xxxxx' that could not be found.

  • The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)

  • Action:

  • Consider defining a bean of type 'xxx.xxxx.xxxx.xxxxxx.xxxxxx.service.portal.v01.service.xxxxx' in your configuration.

 NoSuchBeanDefinitionException: No qualifying bean of type 'xxx.xxxxx.xxxx.service.portal.v01.service.XxxxXxx' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 

解决方案 

在service实现类(xxxxxxImpl.java)里添加

@Service('xxxxxx')

报错详情:

  • Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

  • 2022-08-03 09:41:13.156|ERROR|||||||||||main|LoggingFailureAnalysisReporter|

  • ***************************

  • APPLICATION FAILED TO START

  • ***************************

  • Description:

  • Field UserRoleRefv01Service in com.xxx.xxxx.xxxxx.xxxxxx.controller.v01.controller.xxxxxController required a bean of type 'xxx.xxxx.xxxx.xxxxxx.xxxxxx.service.portal.v01.service.xxxxx' that could not be found.

  • The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)

  • Action:

  • Consider defining a bean of type 'xxx.xxxx.xxxx.xxxxxx.xxxxxx.service.portal.v01.service.xxxxx' in your configuration.

 NoSuchBeanDefinitionException: No qualifying bean of type 'xxx.xxxxx.xxxx.service.portal.v01.service.XxxxXxx' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 

解决方案 

在service实现类(xxxxxxImpl.java)里添加

@Service('xxxxxx')

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论