File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes readObject() throwing EOFException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "readObject() throwing EOFException" Watch "readObject() throwing EOFException" New topic

readObject() throwing EOFException

Colleen Lynch

Joined: Jun 18, 2001
Posts: 15
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!!!
[This message has been edited by Colleen Lynch (edited November 07, 2001).]
Jon Branham

Joined: Mar 16, 2003
Posts: 2
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

Joined: Mar 16, 2003
Posts: 2
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.
I agree. Here's the link:
subject: readObject() throwing EOFException
It's not a secret anymore!