报错: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
报错:Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.aop.aop20250508_2.service.impl.AccountServiceImpl' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound


原因是:大概是找不到bean或bean未被定义之类的,根据报错信息来看是在“com.aop.aop20250508_2.service.impl.AccountServiceImpl”这个类出的问题,然后发现
在第10行未添加注解“@Service”,加上之后解决了,如下所示:

本文来自博客园,作者:里莉,转载请注明原文链接:https://www.cnblogs.com/liliisme/p/18867115

浙公网安备 33010602011771号