关于A component required a bean of type ‘mapper.UserDao‘ that could not bef

执行以后报错这个
解决办法就是实体类没有扫描Mapper接口

@MapperScan("mapper文件的目录")

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.abc.token.mapper") // mapper注解
public class JiangZuoShaoFuApplication {

    public static void main(String[] args) {
        SpringApplication.run(JiangZuoShaoFuApplication.class, args);
    }
}

你可能感兴趣的:(java,mybatis,spring)