The unit test code is as follows:
after running, the console reports an error
Caused by: org.springframework.beans . factory.BeanCreationException : Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [ applicationContext.xml ]: Invocation of init method failed; nested exception is org.springframework.core .NestedIOException: Failed to parse mapping resource: ‘file [D:\eclipse2019_ jdk\2019xiangmu\television\target\classes\mapper\ AdminMapper.xml ]’; nested exception is org.apache.ibatis . builder.BuilderException : Error parsing Mapper XML. The XML location is ‘file [D:\eclipse2019_ jdk\2019xiangmu\television\target\classes\mapper\ AdminMapper.xml ]’. Cause: java.lang.IllegalArgumentException : Result Maps collection already contains value for com.syn.television . dao.AdminMapper.BaseResultMap |
---|
And my spring configuration file is
after searching on the Internet, I learned from it https://www.cnblogs.com/hfx123/p/9685721.html
After annotating , it runs successfully (I don’t quite understand the specific reasons now)
I also hope that the God passing by can give you your understanding.
Read More:
- Error creating bean with name ‘sqlsessionfactory’ defined in class path resource
- Error creating bean with name ‘datasource’ defined in class path resource
- Error creating bean with name ‘requestMappingHandlerAdapter‘ defined in class path resource
- Error creating bean with name ‘lettuceClientResources‘ defined in class path resource
- Error creating bean with name ‘redisTemplate‘ defined in class path resource [xx/RedisConfig.class]
- Error creating bean with name ‘feignTargeter‘ defined in class path resource [org/springframework/cl
- Error creating bean with name ‘entitymanagerfactory’ defined in class path resource
- Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource
- Error creating bean with name ‘sqlsessionfactory’ defined in ServletContext resource)
- Error creating bean with name ‘sqlsessionfactory’ appears in SSM framework integration‘
- Solution to the problem of spring boot running test class error creating bean with name ‘serverendpoint exporter’ defined
- An error happened during template parsing (template: “class path resource
- Error creating bean with name ‘application‘: Instantiation of bean failed;
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘use
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- Error creating bean with name ‘helloController‘: Injection of autowired dependencies failed;
- Error creating bean with name ‘redissonclient’:
- Error creating bean with name usercontroller appears when springboot starts
- Error creating bean with name ‘org.springframework.security.oauth2.config.annotation.web.configurati
- About error creating bean with name ‘xxxxx’: invocation of init method