StreamCorruptedException - invalid stream header during reading object from Stream.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Prabhu_Subbu
Posted On:   Friday, September 6, 2002 12:24 AM

Hi all, I get the java.io.StreamCorrputedException : invalid stream header during reading an object from an applet. All I do is send a String object to the server, the server does some processing and returns a Vector object, and the Exception occurs on the client side(applet) during reading the object. As per the specification, the objects that I send are serializable, they do have default constructors. I also happened to look at the Java Source Code.. This is the method giving the exception called in the constructor of ObjectInputStream() protected void readStreamHeader() throws IOException, StreamCorruptedException { if (bin.readShort() != STREAM_MAGI   More>>

Hi all,
I get the java.io.StreamCorrputedException : invalid stream header during reading an object from an applet. All I do is send a String object to the server, the server does some processing and returns a Vector object, and the Exception occurs on the client side(applet) during reading the object.

As per the specification, the objects that I send are serializable, they do have default constructors.

I also happened to look at the Java Source Code..
This is the method giving the exception called in the constructor of ObjectInputStream()


protected void readStreamHeader()
throws IOException, StreamCorruptedException
{

if (bin.readShort() != STREAM_MAGIC ||
bin.readShort() != STREAM_VERSION)
{

throw new StreamCorruptedException("invalid stream header");

}

}


Now setting the control information is what Java is supposed to do.The developer only needs to take care of the formalities of implementing serializable and use readObject() and writeObject() for passing objects in the stream.

I am running this in IE-Java plugin 1.4.0 with WebSphere on Jre 1.2.2. The wonder is the whole setup runs if the applet is accessed over HTTP, I get this exception only using HTTPS.
Anything different to be done if using HTTPS, or can the developer set these control information explicitly..

Do help me out..

Thanks in advance,
Prabhu.    <<Less
About | Sitemap | Contact