我是靠谱客的博主 炙热羊,最近开发中收集的这篇文章主要介绍SSM容器注入错误 StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘waybillController’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘wayBillServiceimpl’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.pakage.mapper.WayBillServiceMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘wayBillServiceMapper’ defined in file [D:devEnglishworkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsPakageSystemWEB-INFclassescompakagemapperWayBillServiceMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.pakage.mapper.WayBillServiceMapper.insertPost
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘wayBillServiceMapper’ defined in file [D:devEnglishworkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsPakageSystemWEB-INFclassescompakagemapperWayBillServiceMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.pakage.mapper.WayBillServiceMapper.insertPost

如上,bean注入错误。
找了一下午,搜了不少,都不对。
最后一点点拆开来,发现是有一个mapper.xml中的resultType值出错。
我把原先的weightPrice更名为weightPriceVO,却忘了修改此处的resultType为新的值,导致bean无法装配!!!
这个故事告诉我们不要乱改已经写好的类的名字。
在这里插入图片描述

补充:
在这里插入图片描述
数据库有关的po对象类,即mapper中装配涉及的po对象类,都要放到mybatis.xml配置的类中,否则同样会报以上错误。

总结:以上错误引起的原因主要为数据库配置中mapper.xml文件有关的容器注入错误。

最后

以上就是炙热羊为你收集整理的SSM容器注入错误 StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException的全部内容,希望文章能够帮你解决SSM容器注入错误 StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部