dcsimg
Serialization with sockets problems ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Razvan_Veina
Posted On:   Monday, July 29, 2002 10:10 PM

Hello I'm trying to develop a complex application that must pass messages between client and server. Each message contains some data (usually kept in Vectors). I have a Message class that holds all the data contained by a message. I'm serializing this Message to the ObjectOutputStream and it seems to work fine. BUT sometimes during execution I get the following exception : java.lang.ClassCastException: Assigning instance of class Message to field java. util.Vector#elementData I can't reproduce it; it is happening just "sometimes". Any idea what can be the problem ?? I also tried a simple small example with one serve   More>>

Hello


I'm trying to develop a complex application that must pass messages between client and server. Each message contains some data (usually kept in Vectors). I have a Message class that holds all the data contained by a message. I'm serializing this Message to the ObjectOutputStream and it seems to work fine.


BUT sometimes during execution I get the following exception :


java.lang.ClassCastException: Assigning instance of class Message to field java.
util.Vector#elementData


I can't reproduce it; it is happening just "sometimes".


Any idea what can be the problem ??


I also tried a simple small example with one server and two clients that continuously pass Messages between them. If the messages are passed at high speeds, then when the second client is started I get the same exception.


So, again, any idea ? I can show you the code if needed...

   <<Less

Re: Serialization with sockets problems ?

Posted By:   Eric_Lindauer  
Posted On:   Sunday, August 18, 2002 06:56 PM

I suspect that the source code ( a suitably simplified version hopefully! ) and perhaps the actual stack trace would be useful.




-Eric
About | Sitemap | Contact