Spring使用注解出现:No qualifying bean of type...... 在xml文件中添加以下代码,对指定包下的文件进行注解扫描 <context:component-scan base-package="com.itliu"></context:component-scan>