关于spring http invoker中一个常见错误,dubbo 调用 hibernate的set map list
来源:互联网 发布:生态环境监测大数据 编辑:程序博客网 时间:2024/06/06 10:05
- 博客分类:
- 异常
org.springframework.remoting.RemoteAccessExceptionnested exception is java.io.InvalidClassExceptionorg.hibernate.collection.AbstractPersistentCollection
最近有几个项目组在使用spring http invoker调用SSO远程接口时,发现一个错误。
经调查,这个是由于SSO的hibernate版本和某些新项目的hibernate版本不一致造成。 很多人都会奇怪,远程接口调用跟hibernate有什么关系。
其实是这样的:
远程方法返回的复杂对象中包含了set, 这个set一般是hibernate一对多关系从数据库中load出来的。虽然这个set定义的是java.util.set接口, 但是其实实例是:org.hibernate.collection. PersistentSet.
我们看一下org.hibernate.collection. PersistentSet 这个类的定义:。
所以说传到客户端的对象中,其实是包含了PersistentSet,当客户端进行反序列化的时候,由于hibernate版本不一致, 导致报org.hibernate.collection.AbstractPersistentCollection 错误。
- org.springframework.remoting.RemoteAccessException:
- Could not deserialize result from HTTP invoker remote service [http://192.168.180.15:8080/spring-http-invoker/httpservice/userInfoService];
- nested exception is java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection;
- local class incompatible: stream classdesc serialVersionUID = -7982170513654570219, local class serialVersionUID = -5723701046347946317
经调查,这个是由于SSO的hibernate版本和某些新项目的hibernate版本不一致造成。 很多人都会奇怪,远程接口调用跟hibernate有什么关系。
其实是这样的:
远程方法返回的复杂对象中包含了set, 这个set一般是hibernate一对多关系从数据库中load出来的。虽然这个set定义的是java.util.set接口, 但是其实实例是:org.hibernate.collection. PersistentSet.
我们看一下org.hibernate.collection. PersistentSet 这个类的定义:
- public class PersistentSet extends AbstractPersistentCollection implements Set
所以说传到客户端的对象中,其实是包含了PersistentSet,当客户端进行反序列化的时候,由于hibernate版本不一致, 导致报org.hibernate.collection.AbstractPersistentCollection 错误。
0 0
- 关于spring http invoker中一个常见错误,dubbo 调用 hibernate的set map list
- Spring HTTP Remote Invoker的一个问题
- Spring 远程调用 HTTP invoker
- Hibernate常见的集合映射 Set,List,Array,Map,Bag
- 关于hibernate中set、list、map标签的用法与配置含义。
- 关于hibernate中set、list、map标签的用法与配置含义
- 关于hibernate中set、list、map标签的用法与配置含义
- 使用Spring HTTP invoker进行远程调用
- Spring HTTP Invoker-远程调用模式
- 【JAVA】Spring HTTP Invoker 远程服务调用
- 关于dll调用的一个常见错误
- spring中props,list,set,map元素的用法
- spring中props,list,set,map元素的用法
- spring中props,list,set,map元素的用法
- 【转】spring中props,list,set,map元素的用法
- Spring中注入List Set Map Properties的配置文件
- spring中props,list,set,map元素的用法
- 关于java中List、Set、Map的一些总结
- 前端杂记_持续更新
- Android 自定义smartImageView
- 合并文件 SequenceInputStream
- new一个类的指针(不同括号的区别)
- 3516A-sample的使用3--vio实现CVBS输出
- 关于spring http invoker中一个常见错误,dubbo 调用 hibernate的set map list
- 简单的爬取豆瓣电影
- java 开发_数字转换汉语中 人民币的大写
- TCP/IP四层模型中协议的格式
- Android中如何将View的内容转换为图片
- DDR SDRAM工作原理
- 51nod 1674 区间的价值 V2
- mysql数据库容量及表大小查询语句
- js图片自动轮播