Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No MyBatis mapper #127

Open
zhouxianjun opened this issue May 2, 2018 · 2 comments
Open

No MyBatis mapper #127

zhouxianjun opened this issue May 2, 2018 · 2 comments

Comments

@zhouxianjun
Copy link

zhouxianjun commented May 2, 2018

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

@hakil
Copy link

hakil commented May 18, 2018

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

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

@hakil
Copy link

hakil commented Aug 28, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants