NickstaDB / SerializationDumper

A tool to dump Java serialization streams in a more human readable form.
MIT License
994 stars 125 forks source link

java.lang.RuntimeException: Error: Unexpected identifier for object field value 0x7e #7

Closed jbonch closed 4 years ago

jbonch commented 4 years ago

During deserialization the following exception occurs:

                    classdata
                      com.mypackage.MyClass
                        values
                          myEnumField
                            (object)

Exception in thread "main" java.lang.RuntimeException: Error: Unexpected identifier for object field value 0x7e at nb.deser.SerializationDumper.readObjectField(SerializationDumper.java:1519) at nb.deser.SerializationDumper.readFieldValue(SerializationDumper.java:974) at nb.deser.SerializationDumper.readClassDataField(SerializationDumper.java:924) at nb.deser.SerializationDumper.readClassData(SerializationDumper.java:862) at nb.deser.SerializationDumper.readNewObject(SerializationDumper.java:458) at nb.deser.SerializationDumper.readContentElement(SerializationDumper.java:350) at nb.deser.SerializationDumper.readClassData(SerializationDumper.java:878) at nb.deser.SerializationDumper.readNewObject(SerializationDumper.java:458) at nb.deser.SerializationDumper.readObjectField(SerializationDumper.java:1495) at nb.deser.SerializationDumper.readFieldValue(SerializationDumper.java:974) at nb.deser.SerializationDumper.readClassDataField(SerializationDumper.java:924) at nb.deser.SerializationDumper.readClassData(SerializationDumper.java:862) at nb.deser.SerializationDumper.readNewObject(SerializationDumper.java:458) at nb.deser.SerializationDumper.readContentElement(SerializationDumper.java:350) at nb.deser.SerializationDumper.parseStream(SerializationDumper.java:322) at nb.deser.SerializationDumper.main(SerializationDumper.java:104)

example_to_reproduce_src.zip

PhantomYdn commented 4 years ago

Occasionally got the same.

jbonch commented 4 years ago

The cause of this issue is enum field type of the object. I have created a pull request to fix this https://github.com/NickstaDB/SerializationDumper/pull/8

@NickstaDB could you please take a look and merge my pull request if the fix is correct?

NickstaDB commented 4 years ago

@jbonch merged - thanks for the report, sample code, and PR!