wood burning stoves 2.0*
The moose likes Java in General and the fly likes Problem with serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem with serialization" Watch "Problem with serialization" New topic
Author

Problem with serialization

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 309
I am having a problem with serialization. I am serializing to a string a CachedRowSetImpl object in a server.

and I return the string in an HTTP request. I am getting the error "java.io.StreamCorruptedException: invalid stream header:EFBFDEF" trying to deserialize the object in the line "cachedRowSet = (CachedRowSet) objectInputStream.readObject(); "


Your help will be greatly appreciated,
Alejandro Barrero
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 309
I am also having problem with XML serialization. On the server I have

In the client I have

But the text that I am getting is only "<?xml version="1.0" encoding="UTF-8"?> <java version="1.6.0_20" class="java.beans.XMLDecoder"> <object class="com.sun.rowset.CachedRowSetImpl"/> </java>"; there is no data!

Also, I was trying originally to transer the CachedRowSetImpl object constructing a JSON string (Google JSON ) but I was getting an error that the object had a circular reference.

What I really want to do is to serialize and transfer a JDBC ResultSet. Can anybody tell me how to do that?
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 309
RESOLVED. I am using Java serialization and I use URL encode to send and URL decode to receive.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with serialization
 
Similar Threads
Statement.executeQuery fails --RESOLVED--
Byte vs Character streams
Error deserializing Object
Problem returning serialized CachedRowSetImpl in servlet
Convert an Object to ByteArray