File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "EOFException on readObject()" Watch "EOFException on readObject()" New topic
Author

EOFException on readObject()

Stelios Kotsifos
Greenhorn

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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EOFException on readObject()