Has anyone tried deserializing a JMS Object message from IBM MQ Visual Edit? I need to decipher an object that was send as a JMS message through MQ. I saved the message to a file and tried to read it using ObjectInputStream as follows:
ObjectInputStream objectStream = new ObjectInputStream(new DataInputStream(new FileInputStream("PATH TO THE FILE")));
SomeObject result = ((SomeObject)objectStream.readObject());
But I get an error:
java.io.StreamCorruptedException: invalid stream header: 52464820
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:794)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:291)
at com.railinc.emis.transaction.model.DeserializerClass.main(DeserializerClass.java:14)
I went an researched a little bit on this and found the same classes that were used to serialize should be used for deserializing.
If someone has tried this before, please let me know your experience with it.