It's not a secret anymore!
The moose likes I/O and Streams and the fly likes EOFException on readObject() 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 "EOFException on readObject()" Watch "EOFException on readObject()" New topic

EOFException on readObject()

Stelios Kotsifos

Joined: Oct 10, 2013
Posts: 1
I have created a server-client application where the client asks for data from the server using a custom Message class. I've made the Message class into a JAR and use it as an external reference in both the server and the client, so both apps would use the same class for serialization/de-serialization. When I send a Message object from the client to the server, I get the EOFException on the line where the server reads from the ObjectInputStream.
This is the server code:

The client is for Android but I don't think that this has anything to do with the problem.
This is the client class:

On the main activity I just have 2 buttons, one to connect to the server and one to send the Message object
This is the Main Activity Code:

Anyone have any idea what's wrong with my code?
I agree. Here's the link:
subject: EOFException on readObject()
It's not a secret anymore!