springboot启动类必要注解

默认存在:@SpringBootApplication
1.注解@MapperScan

1
@MapperScan("com.hachuizi.service.dao")

如果没有,错误情况:

1
2
3
4
5
6
7
8
9
10
11
12
13
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-11-05-16:02:16.006 ERROR 42   --- [main           ] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Field userDao in com.hachuizi.service.UserService required a bean of type 'com.hachuizi.service.dao.UserDao' that could not be found.

或者
java.lang.IllegalArgumentException: At least one base package must be specified
ˆ Back To Top