springboot项目引入通用mapper(tk.mybatis.mapper)的时候一些可能会踩的坑

时间:2021-03-03 15:00:21   收藏:0   阅读:243

主要解决springboot项目引入通用mapper(tk.mybatis.mapper)的时候一些可能会踩的坑:诸如tk.mybatis.mapper.provider.base.BaseSelectProvider.()

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class

 


     tk.mybatis
     mapper-spring-boot-starter
     2.0.0
mapper:
    mappers: cn.hy.hyerp.erp.common.dal.BaseDao
    not-empty: false
    identity: mysql

启动而不是import org.mybatis.spring.annotation.MapperScan;??????不然会报错:

Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseSelectProvider] with root cause
java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.base.BaseSelectProvider.()

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘baseDao‘ defined in file [BaseDao.class]: Invocation of init method failed;

nested exception is tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class

 

原文:https://www.cnblogs.com/youqc/p/14472416.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!