This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with serialization

 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(); "

 
Alejandro Barrero
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 335
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RESOLVED. I am using Java serialization and I use URL encode to send and URL decode to receive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic