Mybatis start after abnormal inherited BaseMapper

说明:异常的全部是org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL).  Cause: java.lang.InstantiationException: tk.mybatis.mapper.provider.base.BaseInsertProvider

The reason is the introduction of import org.mybatis.spring.annotation.MapperScan in Application startup class, but when we developed, Mapper's interface inherits BaseMapper <T> (this from tk.mybatis.mapper.common.BaseMapper package) . So the project at boot time, scan less.

Solution: Application MapperScan start classes instead import tk.mybatis.spring.annotation.MapperScan, the same type of package can be resolved.

Guess you like

Origin www.cnblogs.com/Yanjie153/p/11910309.html