db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilkka Priha <ipr...@surfeu.fi>
Subject Deep option in MetaDataManager of RC4 not fully compatible with RC3
Date Mon, 04 Aug 2003 09:59:19 GMT
Hi

In RC4, mergeDescriptorRepository(repository) calls internally a new 
mergeDescriptorRepository(target, source, deep) method with the deep 
option set to true. The deep option invokes serialization through 
Commmons' SerializationUtils using the ObjectInputStream class, which in 
turn calls Class.forName(name) with the default class loader to resolve 
classes. However, the ClassHelper, which has parsed the original XML of 
the source repository, resolves classes with the context class loader 
returned by Thread.getContextClassLoader(), which can be different from 
the default class loader. If the class is only defined by the context 
class loader, the attempt to serialize it will throw ClassNotFoundException.

This can be avoided by calling the new method explicitly with the deep 
option set to false, but maybe a note in javadoc should be added.

Please, don't remove the context class loader support, it's essential 
when generating persistent classes dynamically :-)

-- Ilkka





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message