ibatis出現Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount錯誤


  1. Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
  2. Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.chong.model.AccountMapper.checkAccount
  3. 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
  4. ### 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
  5. allAccounts
  6. Caught an exception while getting the property values of com.chong.action.AccountAction@451268
  7. 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,修改過來即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM