Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why this stand alone app cannot communicate with servlet

 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I was trying to communicate from a stand alone application to servlet through URL connections. but while retrieving back the information it gives me error that Stream is not seralized.
where i am wrong? pl help.
regards,
Arun
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going to move this to the servlets forum.
Probably get a better response there
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh Dave where you have moved me? There seems no taker for this question....Please help me..
regards,
arun
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact exception and where is it thrown?
Bill
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very likely that the serializer of the client isn't compatible with the serializer on the server.
Try transmitting the data in text format instead of using writeObject.
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exact Error is:
java.io.StreamCorruptedException: Caught EOFException while reading the stream h
eader
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:727
)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:165)
at LogoServer.test.NewServer.readLocal(Compiled Code)
at LogoServer.test.NewServer.run(NewServer.java:46)
 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A little more info, please: + Is the client app or the servlet throwing the exception? I don't think that when you write your objects you should cast them as (Object). See The Java Tutorial: Serializing Objects.
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server application is giving me this error. In any case I will look into the given link and will let you know how much helpful it is.
regards,
arun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic