No bean named 'injectionServiceImpl' is defined
public class TestInjection extends UnitTestBase{
? public TestInjection(){
?? ?? super("classpath*:spring-annotation.xml");
? }
? @Test
? public void testAutoWired(){
?? ?? InjectionService service =super.getBean("injectionServiceImpl");
?? ? ?
?? ?? service.save("autowired");
? }
}
spring-annotation.xml:
<context:component-scan base-package="com.sbk.annotation"></context:component-scan>???
錯誤:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'injectionServiceImpl' is defined
2016-08-12
InjectionServiceImpl類上沒有注入@Component等注解吧?