异常org.hibernate.proxy.HibernateProxy.Forgot to register a type adapter
今天遇到一个这样的问题,发现是是对象代理的原因,将转换json对象中的代理对象赋为空即可;
<pre name="code" class="java">//根据费用申请ID查询交通费用列表CostTrafficList =costTrafficService.findCostTrafficByApplyId(costApplyID);if(CostTrafficList!=null&&CostTrafficList.size()>0){for(CostTraffic ct:CostTrafficList){ct.setTransportation(null);}}HashMap map=new HashMap();map.put("CostTrafficList", CostTrafficList);jr = new JsonResult<HashMap>("000","数据加载成功");jr.setObj(map);this.result=gson.toJson(jr);
异常org.hibernate.proxy.HibernateProxy.Forgot to register a type adapter相关推荐
- springboot出现“org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter?“的解决办法
springboot出现"Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot ...
- 重点技术-20181008-GSON 报错HibernateProxy. Forgot to register a type adapter?
摘要: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a ...
- Attempted to serialize java.lang.Class: com.cao.bean.DmCategory. Forgot to register a type adapter?
使用mybatis从数据库获取的数据,用gson进行传参出现错误以下报错: 我使用的mybatis是采取懒加载的方式查询数据库,也就是只有用到了才去查真正的数据,用不到的话只是返回一个代理对象,gso ...
- Attempted to serialize java.lang.Class Forgot to register a type adapte
今天使用Mybatis练手,准备将db中查出来的结果集序列化,使用Gson 代码如下 List<User> users1 = userMapper.selectUserCollectio ...
- No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer解决方法
No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer解决方法 参考文章: ...
- java bean lazy proxy_java – Hibernate @Proxy(lazy = false)注释做什么...
在尝试序列化作为JPA实体的ESRBRating对象时,我遇到了两个不同的堆栈跟踪(见下文).我正在使用Spring Data JPA.控制器调用服务,称为存储库的服务.我能够通过在我的ESRBRat ...
- hibernate 中 Provided id of the wrong type for class 异常
今天在工作中遇到了一个问题,在hibernate的使用过程中抛出了个异常: HTTP Status 500 - Provided id of the wrong type for class com. ...
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class *** Expected ***
今天上生产发现warn日志有异常,就查看了下: 2018-12-05 10:05:05.666 [pool-4-thread-1] ERROR org.springframework.batch.co ...
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itheima.domain.Custo
错误: org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itheima.domain.C ...
最新文章
- ThinkPHP框架学习之CRUD
- 百度安全 TrustZone SDK 正式成为 OP-TEE 官方推荐 Rust 开发环境
- C# RichTextBox 做简单的HTML代码编辑器 ---------利用WinApi修正左侧显示行号 误差
- CentOS7 安装Redis Cluster集群
- linux中同步例子(完成量completion)
- 获取内网、通过外部网站返回得到内网外部IP (C#/VB.NET)
- 【学习Spring框架】依赖注入和控制反转异同?
- 计算机怎么用鼠标,如何正确使用鼠标,这些知识你知道吗?
- [实用代码] 基于CH554电容触摸屏IIC转USB转IIC方案代码分享
- AcWing120 防线
- 冬天吃柿子养颜防衰老
- http系列---OpenSSL生成根证书CA及签发子证书
- Excel导入导出百万级数据
- Kafka Shell Lag
- sda、sdb、sdc、sda1、sda2的意思
- 一个或多个数据库无法访问,因而不会在数据库访问选项卡中显示
- 【Demllie航天】火箭方程
- 4核cpu云服务器性能,4核cpu云服务器性能测试
- 小傻蛋的妹妹跟随小甲鱼学习Python的第一节001
- 耀之阳电商:店铺怎么样打造爆款