老师,我的代码和您的一样,但是会出现以下编译错误
来源:5-7 swagger2的使用与接口测试

幕布斯5279810
2021-02-19
2021-02-19 21:56:49,985 [main] [org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer.logAutoConfigurationReport(AutoConfigurationReportLoggingInitializer.java:101)] - [INFO]
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2021-02-19 21:56:49,988 [main] [org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:771)] - [ERROR] Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘registLoginController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘userMapper’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘usersMapper’ defined in file [F:\eclipsework\imooc-videos-dev\imooc-videos-dev-mapper\target\classes\com\imooc\mapper\UsersMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.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 [F:\eclipsework\imooc-videos-dev\imooc-videos-dev-mini-api\target\classes\mapper\SearchRecordsMapper.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.imooc.mapper.SearchRecordsMapper.BaseResultMap
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
2回答
-
代码百分百不一样,检查mapper有没有重复的,肯定出错了噢
112021-02-19 -
幕布斯5279810
提问者
2021-02-19
是这里的mapper文件有没有重复吗,这怎么判断是否有重复呢
042021-02-19
相似问题
回答 1
回答 2