Cause: java.lang.IllegalArgumentException: Result Maps collection contains value for com.angus.dao

博客指出使用MyBatis时,出现org.springframework.beans.factory.BeanCreationException错误,原因是***Mapper.xml文件存在错误。解析映射资源失败,Result Maps集合包含异常值。重新生成一份xml文件后,问题得到解决。

错误如下,

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in class path resource
[spring/applicationContext.xml]:
Invocation of init method failed;
nested exception is org.springframework.core.NestedIOException:
Failed to parse mapping resource: 'file
[E:\ideaworkspace\ssmdemo\target\classes\sqlMap\StudentMapper.xml]';
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML.
Cause: java.lang.IllegalArgumentException:
Result Maps collection contains value for com.angus.dao.StudentMapper.BaseResultMap already

错误原因是

 mybatis 的 ***Mapper.xml 文件里边有错误了。 

org.springframework.beans.factory.BeanCreationException:

使用类路径资源中定义的名称为“sqlSessionFactory”创建bean时出错

(spring /中):

初始化方法调用失败;

嵌套异常是org.springframe .core. nestedioexception:

解析映射资源失败:'file

目标\ [E: \ ideaworkspace \ ssmdemo \ \ sqlMap \ StudentMapper.xml类)”;

嵌套异常是org.apache.ibatis.builder。BuilderException:错误解析映射器XML。

原因:java.lang.IllegalArgumentException:

Result Maps集合包含com.angus.dao.StudentMapper的值。

  红色标出的部分,说明是xml文件出错。我是重新生成了一份。然后问题就解决了。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值