MyBatis-Spring-Boot icon indicating copy to clipboard operation
MyBatis-Spring-Boot copied to clipboard

No MyBatis mapper

Open zhouxianjun opened this issue 7 years ago • 2 comments

image RT: 为什么会报这个警告?但是不影响使用! debug 如下: 这是第一次的: image 这是第二次的: image

zhouxianjun avatar May 02 '18 08:05 zhouxianjun

强迫症,也在看这个问题。 入口应该是在 tk.mybatis.mapper.autoconfigure.MapperAutoConfigurationorg.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration

如果没有MapperFactoryBean实例,则从根路径扫描@Mapper注解类 2 3Application类上已经使用了tk@MapperScan注解,启动信息显示没有找到MapperFactoryBean实例,但debug发现已经扫描到了Mapper,这就让我很费解了。 111 至于两次warn是因为Pagehelper依赖mybatis-spring-boot-starter

hakil avatar May 18 '18 05:05 hakil

如果集成了mapper-spring-boot-starterpagehelper-spring-boot-starter 就屏蔽掉Mybatis中的自动配置,减少一次扫描@Mapper@SpringBootApplication(exclude = MybatisAutoConfiguration.class) 剩下的一次WARN忽略掉吧,为了兼容@Mapper注解,这里做个开关会比较好。

hakil avatar Aug 28 '18 06:08 hakil