cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: ClassCastException becuase of different classloaders for a bean weaving by springframework
Date Thu, 28 Sep 2006 15:01:58 GMT
Rice Yeh wrote:
> It does make a big difference. loadClass(name, false) in DefaultClassLoader
> uses child-first loading strategy but loadClass(name, false) in ClassLoader
> uses parent-first loading strategy. 
Yes.

> Then, when an instance of
> DefaultClassLoader calls its paren's loadClass(name, false) and this parent
> is alos an instance of DefaultClassLoader, the old code will load the class
> from the top classloader (like AppClassLoader loading class from classpath).
And this is the thing I currently do not understand :) (might be my
brain still on vacation?) If the parent is a DefaultClassLoader then the
call to loadClass(name) from the child default class loader will go
through the default implementation inherited from the ClassLoader class
which will then call loadClass(name, false) in the DefaultClassLoader class.

Carsten

Mime
View raw message