ibatis出现Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount错误
- Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
- Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
- Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
- ### Error building SqlSession. ### The error may exist in com/chong/model/AccountMapper.xml ### The error occurred while processing mapper_resultMap[cc_account] ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
- allAccounts
- Caught an exception while getting the property values of com.chong.action.AccountAction@451268
- Caught an exception while getting the property values of com.chong.action.AccountAction@451268 - Class: ognl.OgnlRuntime File: OgnlRuntime.java Method: getMethodValue Line: 1456 - ognl/OgnlRuntime.java:1456:-1re
错误原因是由于使用ibatis的AccountMapper.xml实现接口AccountMapper.java中的方法的时候的id有重复的值,比如
<select id="checkAccount" parameterType="com.chong.model.Account" resultType="int">中的checkAccount在一个xml文件中有两个这样的id,修改过来即可