我是靠谱客的博主 坚强钻石,最近开发中收集的这篇文章主要介绍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 of init method failed; nested exception is org.springframework.core.NestedIOException: Fa所遇到的程序开发问题。

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

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

评论列表共有 0 条评论

立即
投稿
返回
顶部