找不到Banner
来源:2-3 Jaskson序列化库的重要配置(SNAKE_CASE、时间戳)
c1eye
2021-10-08 11:10:53
数据库中有记录,对比过源码,bean代码一致,数据库也是直接用sql文件生成的,但是访问这个接口会报错:
@GetMapping("/test/{id}")
public Banner getById(@PathVariable(name = "id") Long id){
return bannerService.getById(id);
}
Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Unable to find com.c1eye.server.model.Banner with id 4; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unable to find com.c1eye.server.model.Banner with id 4 (through reference chain: com.c1eye.server.model.Banner$HibernateProxy$FVu66kTd["create_time"])]
1回答
7七月
2021-10-08
这样的问题肯定需要自己调试下的,源码和课程里都没问题,肯定还是哪里写的不太对。调试下
相似问题