First question, how are you sending Objects to the servlet? Are you
sure that immediately following the HTTP header is your object? Why don't
you read the bytes and print them out to see if, perhaps, there is an extra
space or new line character in what you are reading?
Randy
> -----Original Message-----
> From: Narinder Singh [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 28, 2001 2:53 AM
> To: [EMAIL PROTECTED]
> Subject: Getting java.io.StreamCorruptedException (URGENT).
>
>
> Hi
>
> I am using tomcat 3.2.3.
> I am getting java.io.StreamCorruptedException while trying to
> read objects
> from servlet.
>
> Here is the Exception (stack trace)
>
> java.io.StreamCorruptedException: InputStream does not
> contain a serialized
> object
> at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
> at java.io.ObjectInputStream.<init>(Unknown Source)
> at com.quark.client.Connect.uploadObject(Connect.java:229)
>
>
> and the code for getting the object follows
>
> outputToServlet = new
> ObjectOutputStream(urlConnection.getOutputStream());
> outputToServlet.writeObject(objectToServer);
> inputFromServlet = new
> ObjectInputStream(urlConnection.getInputStream());
> // Exception occurs here
>
>
> I have narrowed down the problem to the 'ObjectInputStream' class's
> readStreamHeader() method.
> the exception is throws on STREAM_MAGIC mismatch.
>
> Also this exception occurs only for some particular objects (i.e for
> particular state).
> Can any one please tell what might be the possible cause of problem.
>
>
> Regards
> Narinder
> [EMAIL PROTECTED]
>
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>