当你的Spring IOC 容器(即applicationContext.xml文件)忘记配到web.xml 文件中时

当你的Spring IOC 容器忘记配到web.xml 文件中时,启动服务器就会报错。

部分错误如下:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.zcd.linkage.services.LinkageService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

说找不到service层中的Bean,因为我们使用Spring的声明式事务来管理嘛,所以找不到applicationContext.xml文件就会报这样的错误。

原文地址:https://www.cnblogs.com/GooPolaris/p/7919782.html