English 中文(简体)
如何发现序列 序号物体一览表
原标题:how to discover serialVersionUID of serialized objects

简短问题:如何发现序号的物体序列号。

详细情况:我有一个会议数据库中的一些物体的序列化版本,用于网络应用。 对于其中一些目标,我没有在源代码中具体说明序列VersionUID,因此,科索沃统计局为我设立了一个机构。 我想发现所保存的物体的序列号识别符号是什么,因此,我可以将其硬性编码在我的来源档案中。

我很容易读到序列化数据。 我已经通过并删除了(旧的)会议,这些届会与我目前版本的法典相仿,因此我知道,每个序列化物体都与目前的代码基相匹配。

问题回答

What worked for me is to use ObjectStreamClass.lookup(class).

我采用了一种方法,使本届会议的所有物体在我的数据库中脱射。 然后,我对我感兴趣的每个阶层都进行了反对。 它给我一个反对该阶级的物体。 A ObjectStreamClass Object contained the category name and the seriesVersionUID.

I ll take the output of that and modify my source files accordingly.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签