springboot接口,放回404 Bad Request

分析:这种报错,通常都是json格式有误,导致的,比如说接口接受的对象是JSONArray,但是传进来的参数是JSONObject类型

2024-10-16 10:39:07.555  WARN 18536 --- [io-8688-exec-10] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: syntax error, expect [, actual {, pos 0, fieldName null; nested exception is com.alibaba.fastjson.JSONException: syntax error, expect [, actual {, pos 0, fieldName null]
3----------afterCompletion
2024-10-16 10:39:07.557  WARN 18536 --- [io-8688-exec-10] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]

  

 

posted @ 2024-10-16 10:48  信铁寒胜  阅读(151)  评论(0)    收藏  举报