Today, when writing a project, I encountered a problem as follows:
Org.apache.ibatis.exceptions.PersistenceException:
# # # Error Building sqlsession.
# # # The error may exist in Novelmapper.xml
# # # The error occurred while processing Mapper_resultmap[baseresultmap]
# # # Cause:org.apache.ibatis.builder.BuilderException:Error parsing SQL Mapper Configuration. Cause:org.apache.ibatis.builder.BuilderException:Error parsing Mapper XML. Cause:java.lang.IllegalArgumentException:Result Maps Collection already contains value for Novel.storage.mapper.NovelMapper.BaseResultMap
Cause analysis
When the mybatis-generator is generated, it will append the same content to the original XML and cause the content to be duplicated in the Mapper.xml file. Error!
So find MyBatis automatically generated files are all deleted, re-build can be.
Then regenerate it again!
Thanks for the mistake!
MyBatis Error: Result Maps collection already contains value for NOVEL.STORAGE.MAPPER.NOVELMAPPER.BASERESULTMAP