tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: Getting java.io.StreamCorruptedException (URGENT).
Date Wed, 28 Nov 2001 11:47:04 GMT

	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:NSingh@quark.stpm.soft.net]
> Sent: Wednesday, November 28, 2001 2:53 AM
> To: tomcat-user@jakarta.apache.org
> 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
> NSingh@quark.stpm.soft.net
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message