zoukankan      html  css  js  c++  java
  • 非常规解决方案之Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value

    1 前言

    本地项目打包正常,放到服务器(Ubuntu18.04)运行出现错误。

    URL [jar:file:/root/depoly/example-api.jar!/BOOT-INF/lib/example-common-2.5.0.jar!/mapper/vd/InstanceDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'URL [jar:file:/root/depoly/example-api.jar!/BOOT-INF/lib/example-common-2.5.0.jar!/mapper/vd/InstanceDao.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.example.modules.vd.dao.InstanceDao.InstanceMap

    2 解决方案

    根据网上查找,按照提示是InstanceMap重复,但是查找工程,并没有重复,而且本地编译也是正常。

    <mapper namespace="com.example.modules.vd.dao.InstanceDAO">
    //屏蔽resultMap
        <!--<resultMap type="com.example.modules.vd.entity.InstanceEntity" id="InstanceMap">-->
            <!--<result property="id" column="id"/>-->
            <!--<result property="code" column="code"/>-->
            <!--<result property="status" column="status"/>-->
            <!--<result property="creator" column="creator"/>-->
            <!--<result property="createDate" column="create_date"/>-->
            <!--<result property="updateDate" column="update_date"/>-->
        <!--</resultMap>-->
    
    </mapper>

    屏蔽resultMap后再编译放到服务器再运行就ok了。

    p.s. 这是比较神奇的bug及神奇的解决方案。

    3 小结

    后续若查到真正原因,待更新。

  • 相关阅读:
    2017 ICPC beijing E
    1629 B君的圆锥
    1298 圆与三角形
    通过String获取字符数组
    Java中的代码点与代码单元
    数据库事务隔离级别
    oracle修改密码、添加用户及授权
    Python起航
    软件测试常见概念
    TestNG--@Factory
  • 原文地址:https://www.cnblogs.com/fanbi/p/14446221.html
Copyright © 2011-2022 走看看