org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'www.bw.com.service.UsersService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
问题是框架扫描包时,未扫描到。
解决思路:1在配置文件开启扫描,2包的名字与配置文件一致