我正在使用Redis通过springboot和mysql进行缓存。第一次api调用成功响应,但是第二次开始获取异常
“例外”:“ org.springframework.data.redis.serializer.SerializationException”
t = Tub(id=20, tare_weight=200)
session.merge(t)
session.commit()
{
"timestamp": 1567273795394,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.data.redis.serializer.SerializationException",
"message": "Could not read JSON: Can not construct instance of java.util.ArrayList$SubList: no default no-arguments constructor found\n at [Source: [B@8e02e6; line: 1, column: 56] (through reference chain: java.util.ArrayList[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of java.util.ArrayList$SubList: no default no-arguments constructor found\n at [Source: [B@8e02e6; line: 1, column: 56] (through reference chain: java.util.ArrayList[0])",
"path": "/api/loginModule"
}
@SuppressWarnings("unchecked")
@Cacheable(value = "users", key = "#username")
public List Login(String username, String password, Integer companyId) throws SerializationException {
return lastList;
}