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中
1
2
3
4<mappers> <mapper class="com.fj.dao.UserMapper"/> </mappers>
spring-dao.xml中
1
2
3
4<!-- 绑定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内容请搜索靠谱客的其他文章。
发表评论 取消回复