Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=

Error creating bean with name ‘emplService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [swust.seclab.domain.Role] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}

①可能package中没有配置 namespace 或者配的跟路径不一致
②如果是注解的方式可能忘记写一个@Service
③如果是xml可能是忘记写bean

如果有问题请大家指点,谢谢!

你可能感兴趣的:(spring,java_ee)