今天我用springboot和mybatis做了一个小项目,用逆向工程生成了实体类,mapper,和mapper.xml。我用注解写的普通查询都正常使用,当我用到mapper里面自动生成的mapper的增删改查的方法的时候就会报找不到xml的错误,于是我在yml文件中配置了 mapper-locations: classpath:mybatis/mapper/*.xml这个路劲,结果出现了新的错误,求大神解答啊
第一行完整报错是这样的:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController': Unsatisfied dependency expressed through field 'iCarDetail'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'carDetailImpl': Unsatisfied dependency expressed through field 'carDetailMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'carDetailMapper' defined in file [C:\Users\留不住的年华\Desktop\dragon-f\target\classes\teach\aistar\mapper\CarDetailMapper.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 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.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:\Users\留不住的年华\Desktop\dragon-f\target\classes\mybatis\mapper\CarBrandsMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [C:\Users\留不住的年华\Desktop\dragon-f\target\classes\mybatis\mapper\CarBrandsMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for teach.aistar.mapper.CarBrandsMapper.BaseResultMap