前言 在springboot项目开发中,创建了以个类 实现了ResponseBodyAdvice接口,目的是想统一封装controller层返回给前端的数据格式,想法挺美好,但是断点调试时报错 java.lang.ClassCastException: com.XXXXX.XXXXX.context.ApiResult cannot be cast to java.lang.String at org.springframework.http.converter