I am trying some data from servlet to applet.Before writing the object
into the stream.I set the content type to application/octet.But i am
not able to read the object in the applet end.
URLConnection conn = url.openConnection () ;
conn.setDoInput (true) ;
conn.setDoOutput (true) ;
ObjectOutputStream os = new ObjectOutputStream (conn.getOutputStream
()) ;
os.writeObject (methodName) ;
os.writeObject (parameters) ;
os.writeObject (uniqueId) ;
os.flush() ;
os.close ();
ObjectInputStream is = new ObjectInputStream (conn.getInputStream
());
Serializable ret = (Serializable)is.readObject ();
is.close () ;
It is failing during the statement.
Serializable ret = (Serializable)is.readObject ();
The error message that comes up is
java.io.StreamCorruptedException: Unread data
at java/io/ObjectInputStream.toggleBufferingMode
at java/io/ObjectInputStream.readObject
at com/ms/!!!Internal_Class_1.DefaultReadMethod
at java/io/ObjectInputStream.invokeDefaultReadObject
at java/io/ObjectInputStream.defaultReadObject
at java/io/ObjectInputStream.readNewObject
at java/io/ObjectInputStream.readObject
at java/util/Hashtable.readObject
at java/io/ObjectInputStream.invokeReadObject
at java/io/ObjectInputStream.readNewObject
at java/io/ObjectInputStream.readObject
at com/bt/bfsec/cms/homepage/applet/base/URLObject.readObject
at com/bt/bfsec/cms/homepage/applet/panels/BasePanel.sendMethod
at com/bt/bfsec/cms/applet/listinvoice/ListInvoiceSuperClass.filterButton_ActionPerformed
at com/bt/bfsec/cms/applet/listinvoice/ListInvoiceSuperClass.connEtoM1
at com/bt/bfsec/cms/applet/listinvoice/ListInvoiceSuperClass.access$1
at com/bt/bfsec/cms/applet/listinvoice/ListInvoiceSuperClass$IvjEventHandler.actionPerfor med
at javax/swing/AbstractButton.fireActionPerformed
at javax/swing/AbstractButton$ForwardActionEvents.actionPerformed
at javax/swing/DefaultButtonModel.fireActionPerformed
at javax/swing/DefaultButtonModel.setPressed
at javax/swing/plaf/basic/BasicButtonListener.mouseReleased
at java/awt/Component.processMouseEvent
at java/awt/Component.processEvent
at java/awt/Container.processEvent
at java/awt/Component.dispatchEventImpl
at java/awt/Container.dispatchEventImpl
at java/awt/Component.dispatchEvent
at java/awt/LightweightDispatcher.retargetMouseEvent
at java/awt/LightweightDispatcher.processMouseEvent
at java/awt/LightweightDispatcher.dispatchEvent
at java/awt/Container.dispatchEventImpl
at java/awt/Component.dispatchEvent
at java/awt/EventDispatchThread.run
When i installed this in different UNIX boxes.In one box it was always
failing but in another box it was failing at random intervals which
left me totally puzzled.
Need help!!!!!