今天在工作的时候遇到一个巨坑的bug, 日志提示是这样的。
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService':
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'userBranchAccountService':
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [sys.user.repository.UserRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:
{@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
当时我真的是心里有各种曹尼玛在飞奔,我明明就写了userService和UserRepository @Autowired也是正常的写的,各种不知道原因ÿ