You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Rice Yeh <ri...@gmail.com> on 2007/01/29 07:33:56 UTC

parent-first URLClassLoader being the parent of ReloadingClassLoader seems not correct

Hi,
  I am studing the cocoon-rcl-webapp-wrapper. An instance of URLClassLoader
with loading path setting from /WEB-INF/cocoon/rclwrapper.urlcl.conf (mostly
is from local repository) is passed to as the parent of ReloadingClassLoader
constructor in ReloadingClassloaderManager.getClassLoader(ServletContext
context). Since URLClassLoader is parent first classloader, the classes in
the loading path in /WEB-INF/cocoon/rclwrapper.urlcl.conf will never be
loaded because there are copies of them in WEB-INF/lib and these copies will
be loaded by a WebApplicationClassLoader, which is the parent of
URLClassLoader. Is such design intented?

Regards,
Rice

Re: parent-first URLClassLoader being the parent of ReloadingClassLoader seems not correct

Posted by Reinhard Poetz <re...@apache.org>.
Rice Yeh wrote:
> Hi,
>   I am studing the cocoon-rcl-webapp-wrapper. An instance of 
> URLClassLoader with loading path setting from 
> /WEB-INF/cocoon/rclwrapper.urlcl.conf (mostly is from local repository) 
> is passed to as the parent of ReloadingClassLoader constructor in 
> ReloadingClassloaderManager.getClassLoader(ServletContext context). 
> Since URLClassLoader is parent first classloader, the classes in the 
> loading path in /WEB-INF/cocoon/rclwrapper.urlcl.conf will never be 
> loaded because there are copies of them in WEB-INF/lib and these copies 
> will be loaded by a WebApplicationClassLoader, which is the parent of 
> URLClassLoader. Is such design intented?

Yes. The org.apache.commons.jci.ReloadingClassLoader takes care that the classes 
from /WEB-INF/cocoon/rclwrapper.rcl.conf have precendence over 
/WEB-INF/cocoon/rclwrapper.urlcl.conf.

In WEB-INF/lib there are only libs that are required by the reloading 
classloader itself.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------