Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Require Urgent Help - EOFException while making ObjectOutputStream instance  RSS feed

Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
firstly, I'm getting the EOFException while making ObjectInputStream instance and not ObjectOutputStream instance as mentioned in the subject matter !!
Following is the code through which I 'm trying to read object :
try {
URL AdminLoginServlet = new URL("");
URLConnection servletConnection = AdminLoginServlet.openConnection();
ObjectInputStream inputFromServlet = new ObjectInputStream((InputStream)servletConnection.getInputStream());
String listNames = (String) inputFromServlet.readObject();
} catch(Exception e)
System.out.println("Exception while making servlet URL 22"+ e);
and following is the code through which I'm writing object :
try {
ObjectOutputStream send = new ObjectOutputStream(httpservletresponse.getOutputStream());
System.out.println("Sending user HashMap to applet...");
System.out.println("Writing is done...");
} catch(Exception e)
System.out.println("Exception here saying : "+e);
Writing of object is being done perfectly but while reading I'm getting the ??? It gives me this exception even before I call readObject(), at the time when I try to create ObjectInputStream instance , why is it so ?
Can anybody let me know whats the fault ? What I have to do to read the object correctly ? Can anybody correct my code, plz...
Regards and thanx,
[This message has been edited by Sam Cala (edited June 29, 2001).]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!