This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13586|Reply: 3

[JavaEE] mybatis reported "Result Maps collection already contains value forxxx"...

[Copy link]
Posted on 8/23/2018 3:10:48 PM | | | |
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountMapper' defined in file [C:\project\java\itsvseapi\target\classes\com\ itsvse\test\mapper\AccountMapper.class]: Cannot resolve reference to bean 'DBDataSqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DBDataSqlSessionFactory' defined in class path resource [com/itsvse/test/config/DefaultDataSourceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method ' sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\project\java\itsvseapi\target\classes\mapper\AccountMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.itsvse.test.mapper.AccountMapper.BaseResultMap


When you start tomcat during SSM setup, an error is reported:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountMapper'



Cause:

These codes are automatically generated by the tool, so they are not double-checked. A small mistake led to:

Since the IDs of the methods in the interface AccountMapper.java are implemented when using IBATIS AccountMapper.xml have duplicate values, for example
    <select id="AccountTableMap" resultMap="AccountTableResult"> AccountMapper has two such ids in an xml file, just modify it.





Previous:Redis enables remote access
Next:Docker versions are divided into CE and EE distinctions
Posted on 10/10/2018 1:32:52 PM |
Prompt:Authors are banned or removed content is automatically blocked
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com