Cause: java.io.NotSerializableException: com.hjx.pojo.User
- 对User实体进行序列化,可解决报错
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
private int id;
private String name;
private String pwd;
}
2.在UserMapper.xml文件补全cache标签属性
<cache eviction="FiFO" flushInterval="60000" size="512" readOnly="true"></cache>