zoukankan      html  css  js  c++  java
  • 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,修改过来即可

  • 相关阅读:
    前端综合练习与bootstrap
    05-前端之jQuery
    03-初识JavaScript
    02-初识CSS
    01-前端初识和body标签中的相关标签
    程序员笔记
    windows和Ubantu双系统安装图解
    获取http和ftp地址的图片
    HttpHelper类及调用
    简单的SqlHelper
  • 原文地址:https://www.cnblogs.com/langtianya/p/2966491.html
Copyright © 2011-2022 走看看