找不到Banner

来源:2-3 Jaskson序列化库的重要配置(SNAKE_CASE、时间戳)

c1eye

2021-10-08 11:10:53

https://img.mukewang.com/climg/615fb5f509e6882509560942.jpg

数据库中有记录,对比过源码,bean代码一致,数据库也是直接用sql文件生成的,但是访问这个接口会报错:

@GetMapping("/test/{id}")
public Banner getById(@PathVariable(name = "id") Long id){
   return bannerService.getById(id);
}


https://img.mukewang.com/climg/615fb614092bd4c048500240.jpg

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

这样的问题肯定需要自己调试下的,源码和课程里都没问题,肯定还是哪里写的不太对。调试下

0

Java全栈工程师

从Java到全栈,开发带SKU的真实企业级电商项目(附赠整套UI框架,配套升级Vue3.0内容)

2068 学习 · 3052 问题

查看课程