mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Panko <Sven.Pa...@proximity.de>
Subject [1.0] Three questions concerning object serialization and MINA
Date Wed, 06 Dec 2006 15:17:03 GMT
Hello all,

first of all I like to thank of all you guys - MINA is a really excellent 
piece of software! After using it for more than a year I am fascinated how 
easy it is to implement complex client-server applications without much 
effort! But now to my questions concerning the object serialization 

I was wondering if the ObjectSerializationCodecFactory may be used safely 
in production environments when the only data that is transferred between 
clients and the server are objects (i.e. a custom codec doesn't seem to be 
necessary to me)? The reason I am asking is because the JavaDoc 
description of the class states that the "codec is very useful when you 
have to prototype your application rapidly without any specific codec". 
This sounds as if it should only be used for testing purposes but not 
within a production environment.

Furthermore I was wondering why the decoder and ByteBuffer.getObject() use 
a classloader to check, if the transferred class is available on the 
receiver's platform (deserialization will fail without the check in every 
case when the class to be deserialized isn't available to the receiver, 
won't it?). I am developing a client application using Eclipse RCP and 
class loading is a bit difficult here because the OSGi platform is used to 
control class loading in the Eclipse platform. I wasn't able to use the 
ObjectSerializationCodecFactory out of the box because of NoClassDefFound 
errors produced by the Eclipse class loaders (which are not present if one 
simply uses the ObjectInputStream without specifying a separate 
classloader). Object serialization works find without the additional class 
checks, so I created a mere copy of the decoder and the 
ObjectSerializationCodecFactory to prevent the usage of explicit 
classloaders - but are there any risks involved in doing so which I don't 
see and you are aware of?

My last question concerns the different default max object sizes in the 
en- and decoder implementations - is there a reason why the encoder may 
encode objects up to Integer.MAX_VALUE, but the decoder refuses anything 
above 1MB? Are you aware of some known issues concerning memory 
consumption if I set the max object size of the decoder to 
Integer.MAX_VALUE as well?

Thanks in advance,


Information contained in this message is confidential and may be legally privileged. If you
are not the addressee indicated in this message (or responsible for the delivery of the message
to such person), you may not copy, disclose or deliver this message or any part of it to anyone,
in any form. In such case, you should delete this message and kindly notify the sender by
reply Email. Opinions, conclusions and other information in this message that do not relate
to the official business of Proximity shall be understood as neither given nor endorsed by
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message