编写api接口遇到的问题

问题一: 搭建springboot+mybatis时,报出错误:
“java.lang.IllegalArgumentException: Property 'sqlSessionFactory'”

解决办法:1、依照顺序“实体类,dao,impl,数据实现层,控制层”来排错,检查并改正;

     2、查看依赖是否注入成功,补齐所需的jar包,编译

     3、查看运行类Application.java,如下:

package com.*.*;

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

@SpringBootApplication(scanBasePackages = {"com.*.*"})
@MapperScan("com.*.*.dao")
public class ApidemoApplication {

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

 

posted @ 2018-11-28 09:00  029黄甲栋  阅读(417)  评论(0编辑  收藏  举报