场景重现:调用封装好的接口,返回的数据类型是List,debug可以看到有返回值。但是进行到对list进行操作的那步,报错了(java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast ...
.restTemplate调用的两种方式及获取字符串转换对象model的处理,统一按接收字符串,然后gson转换为对象的方式。 ResponseData对象包含的属性private String resCode private String resMsg private T data import java.lang.reflect.Type import com.google.common.r ...
2020-07-17 06:46 5 309 推荐指数:
场景重现:调用封装好的接口,返回的数据类型是List,debug可以看到有返回值。但是进行到对list进行操作的那步,报错了(java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast ...
报错:java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.xxx.entity.PersonEntity 代码:SessionFactory sf=this.getSessionFactory ...
一、post请求【接口请求参数有params】 RestTemplate restTemplate = new RestTemplate(); String url =domesticAPP_url_Online+"readBook ...
<T> T postForObject(String url, Object request, Class<T> responseType, Map<String,?> uriVariables ...
项目使用spring boot1.5.2 集成mybatis通用mapper插件,发现查询方法selectByPrimaryKey 会导致发生异常—— java.lang.ClassCastException:com.xxx.xxx.entity cannot be cast ...
啊: java.lang.ClassCastException: Ljava.lang.Object ...
啊: java.lang.ClassCastException: Ljava.lang.Objec ...