org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defined

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defined
(1)这个错误的原因是编译器找不到bean 的注入,还可能是你的注入名字写错了。

(2)spring的配置文件 书写错误,没有加入自动扫描功能

这句<context:component-scan base-package="包名"></context:component-scan>

 

posted @ 2016-11-23 18:41  北极的大企鹅  阅读(1296)  评论(0编辑  收藏  举报
阅读 - 79万