Error creating bean with name 'itemController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.manager.itemservice.ItemService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(type=class java.lang.Object, shareable=true, mappedName=, lookup=, authenticationType=CONTAINER, description=, name=)}
错误原因:
classpath:spring/applicationContext-*.xml; 在启动项目时,找不到你指定的位置; 此时的配置只能在classpath下找,无法在其他文件夹下找;具体位置因在target目录下。
解决:
在classpath后加*:classpath*:spring/applicationContext-*.xml
本文解决了一个关于Spring框架中依赖注入失败的问题,详细介绍了错误的原因在于未能找到指定的配置文件,并给出了具体的解决办法。
5781

被折叠的 条评论
为什么被折叠?



