SSM整合,整合spring和mybatis中的错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'khmcServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.xczs.dao.KhmcDao com.xczs.service.impl.KhmcServiceImpl.khmcDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.xczs.dao.KhmcDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
对于以上错误!真如上图平头哥,头痛!!!但无奈!!!一晚上没睡好,一天没过好!翻阅无数博客,无数解答.....没有答案,最后看了又看错误,在网上发现一个老铁说配置问题,于是静下心来看配置!过不其然,配置没错!艹!!为什么?又从头看,看了下加载spring的配置文件--》web.xml。原来是你!!真是众里寻他千百度,回眸一笑百媚生啊!
如图是web.xml中的加载spring的代码,仔细看看你spring文件的命名格式,然后再看看你实际的命名格式,改为跟命名格式一致。不报错了,气死大哥了!所以要注意细节啊!!!

