在学习Spring注解扫描的排除方式的时候
运行test07,却在buid的时候报错
显示test05中No bean named ‘userServiceImpl’ available
applicationContext.xml中的配置:
<context:component-scan base-package="com.liu">
<!-- <context:exclude-filter type="assignable" expression="com.liu.bean.User"/>-->
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
</context:component-scan>
test05中对userServiceImpl进行了调用
UserService userServiceImpl = (UserService) context.getBean("userServiceImpl");
userServiceImpl.register();
将其注释掉之后test07就正常运行了