我是靠谱客的博主 坚强钻石,这篇文章主要介绍Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Fa,现在分享给大家,希望可以做个参考。

Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [C:Users82784IdeaProjectsspring-studyspring-10-mybatistargetclassescomfjdaoUserMapper.xml]’;

IllegalArgumentException: Mapped Statements collection already contains value for com.fj.dao.UserMapper.selectUser. please check com/fj/dao/UserMapper.xml and file [C:Users82784IdeaProjectsspring-studyspring-10-mybatistargetclassescomfjdaoUserMapper.xml]

这两个错误在我整合mybatis-spring时遇到了,整了很久还是没有解决,第二天突然发现我在UserMapper.xml和spring-dao.xml文件中都绑定了同一个UserMapper接口,所以才导致报错

UserMapper.xml中

<mappers>
	<mapper class="com.fj.dao.UserMapper"/>
</mappers>

spring-dao.xml中

<!-- 绑定Mybatis配置文件 -->
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations" value="classpath:com/fj/dao/*.xml"/>

最后

以上就是坚强钻石最近收集整理的关于Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Fa的全部内容,更多相关Invocation内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部