java.lang.IllegalArgumentException: At least one base package must be specified
java.lang.IllegalArgumentException: At least one base package must be specified 一直报这个错误 我mapper的路径写错了吗
java.lang.IllegalArgumentException: At least one base package must be specified 一直报这个错误 我mapper的路径写错了吗
2018-09-06
错误原因:没有在主函数的类中对Mapper层进行扫描。
解决:加上对mapper层的扫描MapperScan
@ComponentScan(basePackages = { "cn.iponkan.controller"})
@MapperScan(basePackages = {"cn.iponkan.mapper"})
@EnableAutoConfiguration
public class SpringBootApplication {
public static void main(String[] args){
SpringApplication.run(SpringBootApplication.class,args);
}
}
举报