Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kryonet库序列化java.sql.Date类异常 #1

Closed
straybirdsnest opened this issue Mar 5, 2015 · 0 comments
Closed

kryonet库序列化java.sql.Date类异常 #1

straybirdsnest opened this issue Mar 5, 2015 · 0 comments
Assignees

Comments

@straybirdsnest
Copy link
Owner

kryonet库序列化java.sql.Date类会发生异常,而Hibernate框架当中Mapping映射时,date类型映射到Java当中是java.util.Date或者java.sql.Date类,实际在MySQL数据库测试中Mapping的是java.sql.Date类,为此产生用Hibernate查询到的对象无法直接通过kryonet进行传送。
由于kryonet官方将不修复类似的问题,故现在的方案是强制Hibernate框架用java.util.Date映射。
参见kryo的issue#88,建议尝试margo的kryo-serializers。
使用margo提供的DateSerializer类序列化之后,存在的bug只剩下被序列化的对象包换循环引用的问题时kryo会栈溢出的问题,因此在使用kryo传送的数据中将取消循环引用的情形以避开此bug。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant