views:

367

answers:

3

In anyone aware of a tool/script/program/whatever to create a java object instance from a binary java serialized object?

I don't have the .class file, so I can't ( afaik ) simply create an ObjectInputStream and load it from there.

This object has the default serialization mechanism, and I'm trying to debug a problem we have.

Anyone?

+1  A: 

I think what you want to accomplish is very similar to this post

Eric
Uh?... What is the answer? Using object serialization/deserialization? I don't have .class file
OscarRyz
The answer was to get the .class file from a URL.
Yishai
+1  A: 

There was a rather detailed post about the format in JavaWorld recently... Might be worth reading.

Link: http://www.javaworld.com/community/node/2915

Fredrik
Yeap, something along this lines. I know there are a couple of tools like asm or other bytecode manipulation tools, but I have never use them before, so I don't know what's the best tool
OscarRyz
A: 

Create a class with the correct name and serialVersionUID. Implement readObject. Use ObjectInputStream.readFields to get the ObjectInputStrem.GetFields.

Tom Hawtin - tackline
I've got InvalidClassException. I guess I need to know what's the correct serialVersionUID. Exception in thread "main" java.io.InvalidClassException: com.o.a.I; enum descriptor has non-zero serialVersionUID: 12885773312
OscarRyz