概述
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所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复