tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Guinois <guino...@icod.ca>
Subject Re: Loader component nested in Context
Date Fri, 02 Mar 2007 14:20:55 GMT
Ok, just found the solution. When adding Loader component intot context 
descriptor, the default value for useSystemClassLoaderAsParent is true 
and cause a ClassNotFound error. To fix I added 
useSystemClassLoaderAsParent="false" on my Loader component.

<Context path="/app"
                 reloadable="true"
                 docBase="C:/solapcore/apacheTest/test/app"
                 workDir="C:/solapcore/apacheTest/test/app/work"
                 override="true">

  <Loader
                className="org.apache.catalina.loader.WebappLoader"
                delegate="false"
                useSystemClassLoaderAsParent="false"
                
loaderClass="org.apache.catalina.loader.WebappClassLoader" />
</Context>

I don't know if It is normal that the default value of the 
useSystemClassLoaderAsParent attribute is not the same value as used 
when "skipping" the Loader component? I didn't found any config file 
anywhere overwritting the default values.


Eric

Eric Guinois a écrit :
> Hi,
>    I'm trying to use my own ClassLoader for my Web-Application. I 
> google a long time and find that the Loader component in the Context 
> component could help me to replace the ClassLoader of my web 
> application (subclassing WebappClassLoader).
>
>    In the first place, I tried to use the default parameters for the 
> Loader component. My context file 
> ($CATALINA_HOME/conf/engine/host/context.xml)  was
>
> <Context path="/app"
>                 reloadable="true"
>                 docBase="C:/apacheTest/test/app"
>                 workDir="C:/apacheTest/test/app/work" />
>
> and my application were loading and working properly.
>
> When I change to
>
> <Context path="/app"
>                 reloadable="true"
>                 docBase="C:/apacheTest/test/app"
>                 workDir="C:/apacheTest/test/app/work" >
> <Loader
>                className="org.apache.catalina.loader.WebappLoader"
>                delegate="false"
>                
> loaderClass="org.apache.catalina.loader.WebappClassLoader" />
> </Context>
>
>
> I always got this error in the console :
>
> 2007-03-01 16:37:19 org.apache.catalina.core.StandardContext start
> GRAVE: Error listenerStart
> 2007-03-01 16:37:19 org.apache.catalina.core.StandardContext start
> GRAVE: Erreur de dÚmarrage du contexte [/app] suite aux erreurs 
> prÚcÚdentes
>
> I googled and searched for information with this error and googled for 
> example using Loader component without any success.
>
> How can I use the Loader component properly?
>
> I'm using Tomcat 5.5.20 and tried it only under Windows.
>
> Thank you in advance for your time.
>
> Eric Guinois
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message