一直报这个是为什么,之前在启动注解上加个exculd = DataSourceAotucomment.class就好了
来源:4-12 使用knife4j 实现接口文档

慕码人6506582
2022-03-03
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 [E:\imooc-red-book-dev\book-mapper\target\classes\mapper\CommentMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [E:\imooc-red-book-dev\book-mapper\target\classes\mapper\CommentMapper.xml]’. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.sy.mapper.CommentMapper.BaseResultMap
2回答
-
慕码人6506582
提问者
2022-03-03
这个地方啊,亲测,重新使用生成工具的时候,一定要把之前的删干净,不然会一直报这个错,使用多次的同学报了错,记得去检查xml文件里面,是否有多条重复查询语句删掉就好了
122022-05-01 -
风间影月
2022-03-03
因为你引入了数据源的依赖,但是没有配置数据源,配置了就行。建议按照课程步骤,依赖一次性导入很多地方会做自动装配的
042022-03-03
相似问题