SpringBoot+RESTful异常

1. java.io.NotSerializableException

实体类实现Serializable接口

public class Student implements Serializable {
    private int id;
    private String name;
    private int age;
....}

2. java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼

application.properties:

#datasource
spring.datasource.url=jdbc:mysql://localhost:3306/students?serverTimezone=GMT%2B8
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

3. Field ...Mapper in ... required a bean of type '...Mapper' that could not be found.

...Application.java:

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

@SpringBootApplication
@MapperScan("soa.label2.persistence")//映射器扫描
public class Label2Application {

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

猜你喜欢

转载自blog.csdn.net/qq_39380838/article/details/84854736