• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

readObject() throwing EOFException

 
Colleen Lynch
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there...
I am trying to send an object (Vector) from an applet to a servlet. When I call readObject in the servlet, it throws an EOFException. Does anyone have any idea what could be wrong here?
Here is the code in the applet:

And for the servlet:

If anyone has any ideas, I would really appreciate it!!!
Thanks
[This message has been edited by Colleen Lynch (edited November 07, 2001).]
 
Jon Branham
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually have the same problem with a shopping cart object. Within its readObject method i print out all of the data, which is read in perfectly. The readObject method exits and somewhere between that and the typecasting back to the Cart object i get the EOFException.
 
Jon Branham
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok im dumb, i was serializing the cart into a mysql binary field that was too small. I realized this after comparing byte lengths of the input and output byte arrays. Thats where my EOFException came from.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic