简短问题:如何发现序号的物体序列号。
详细情况:我有一个会议数据库中的一些物体的序列化版本,用于网络应用。 对于其中一些目标,我没有在源代码中具体说明序列VersionUID,因此,科索沃统计局为我设立了一个机构。 我想发现所保存的物体的序列号识别符号是什么,因此,我可以将其硬性编码在我的来源档案中。
我很容易读到序列化数据。 我已经通过并删除了(旧的)会议,这些届会与我目前版本的法典相仿,因此我知道,每个序列化物体都与目前的代码基相匹配。
简短问题:如何发现序号的物体序列号。
详细情况:我有一个会议数据库中的一些物体的序列化版本,用于网络应用。 对于其中一些目标,我没有在源代码中具体说明序列VersionUID,因此,科索沃统计局为我设立了一个机构。 我想发现所保存的物体的序列号识别符号是什么,因此,我可以将其硬性编码在我的来源档案中。
我很容易读到序列化数据。 我已经通过并删除了(旧的)会议,这些届会与我目前版本的法典相仿,因此我知道,每个序列化物体都与目前的代码基相匹配。
由于你掌握了数据,你可以简单地看看看一下在以下网址上填写的表格:
00000000: aced 0005 7372 0003 466f 6f00 0000 0000 ....sr..Foo.....
00000010: 0000 0102 0001 4c00 066d 794e 616d 6574 ......L..myNamet
00000020: 0012 4c6a 6176 612f 6c61 6e67 2f53 7472 ..Ljava/lang/Str
00000030: 696e 673b 7870 7400 044a 6f68 6e ing;xpt..John
The name of the class above is "Foo" (no package), and the serialVersionUID is 1L. Here s another example:
00000000: aced 0005 7372 0011 7374 6163 6b6f 7665 ....sr..stackove
00000010: 7266 6c6f 772e 466f 6fff ffff ffff 7e3c rflow.Foo.....~<
00000020: 1802 0001 4c00 066d 794e 616d 6574 0012 ....L..myNamet..
00000030: 4c6a 6176 612f 6c61 6e67 2f53 7472 696e Ljava/lang/Strin
00000040: 673b 7870 7400 044a 6f68 6e g;xpt..John
The classname is stackoverflow.Foo. The serialVersionUID is 0xff7e3c18 as noted by this sequence of octets:
ff ffff fffff 7e3c 18
现在,你们都必须研究文件格式,以发现你在每种情况下的物体,并读到上文相联的地图中紧接着的statName。
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.
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 ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
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 ...
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 ...
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....
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 ...