您的位置:首页 > 编程语言 > Java开发

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

2019-07-11 11:07 567 查看

错误如下,

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文件出错。我是重新生成了一份。然后问题就解决了。 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐