• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with serialization

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RESOLVED. I am using Java serialization and I use URL encode to send and URL decode to receive.
 
No more fooling around. Read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic