473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Concerns in Serialization.

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!!!!!
Jul 17 '05 #1
0 1547

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Remi | last post by:
Hello Everybody! I am going to develop a multi-language website which will include Traditional Chinese, Simplified Chinese, Thai, Japanese, etc. (and English as well). I would like to take an...
37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
1
by: andrewcw | last post by:
There is an error in XML document (1, 2). I used XML spy to create the XML and XSD. When I asked to have the XML validated it said it was OK. I used the .net SDK to generate the class. I have...
3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
5
by: Nikola Skoric | last post by:
I ran in Mono a program developed on .NET Framework 2.0 and it ran OK until I tried to desirialize a object. There the program died abruptly dumping this: System.ArgumentOutOfRangeException:...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.