springboot 2.1.4 与mybatis 3.5.+出现的问题

两个版本之间出现的问题

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'umCityController': Unsatisfied dependency expressed through field 'umCityService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'umCityServiceImpl': Unsatisfied dependency expressed through field 'umCityMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'umCityMapper' defined in file [E:\WorkSpace\micro-admin\micro-admin-web\target\classes\com\ikuijia\micro\admin\web\dal\mapper\UmCityMapper.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.apache.ibatis.type.TypeException: The alias 'Criteria' is already mapped to the value 'com.ikuijia.micro.admin.web.dal._do.UmUserOfficeExample$Criteria'.

springboot 2.1.4 与mybatis 3.5.+出现的问题_第1张图片

 

如果把mybatis的版本修改为3.4 则不会出现此问题,学识有限,不知道是什么原因。若有大神研究,请告知!


   org.springframework.boot
   spring-boot-starter-parent
   2.1.4.RELEASE
    



   org.mybatis.spring.boot
   mybatis-spring-boot-starter
   2.0.1

此版本有问题会出现问题,引用的是mybatis 3.5+

   org.mybatis.spring.boot
   mybatis-spring-boot-starter
   1.3.2

此版本不会 引用的是mybatis 3.4+

 

你可能感兴趣的:(java,spring,boot,mybatis)